4 bottles of champagne in a jeroboam
Matrix-Addition(a,b)1 for i =1 to rows [a]2 for j =1 to columns[a]3 Input a[i,j];4 Input b[i,j];5 C[i, j] = A[i, j] + B[i, j];6 Display C[i,j];
#include<stdio.h> #include<conio.h> void main() { int i,j,k,l,m; clrscr(); for(i=0;i<4;i++) { for(j=i+1;j<=4;j++) { printf("%d",j); } for(k=1;k<=i;k++) { printf("%d",k); } printf("\n"); for(k=i;k>=1;k--) { printf("%d",k); } for(j=4;j>=i+1;j--) { printf("%d",j); } getch(); }
#include<stdio.h> #include<conio.h> main() { int a[4][4],b[4][4],c[4][4],i,j; printf("enter the elements of matrix a"); for(i=0;i<=3;i++) for(j=0;j<=3;j++) scanf("%d",&a[i][j]); printf("the first matris is"); for(i=0;i<=3;i++) { printf("\n"); for(j=0;j<=3;j++) printf("%d",a[i][j]); } printf("Enter the elements of second matrix"); for(i=0;i<=3;i++) for(j=0;j<=3;j++) scanf("%d",&b[i][j]); printf("the second matrix is"); for(i=0;i<=3;i++) { printf("\n"); for(j=0;j<=3;j++) printf("%d",b[i][j]); } for(i=0;i<=4;i++) for(j=0;j<=4;j++) c[i][j]=a[i][j] + b[i][j]; printf("the addition of matrix is"); for(i=0;i<=3;i++) { for(j=0;j<=3;j++) printf("%d\t",c[i][j]); printf("\n"); } getch(); }
//to multiply two matrices... #include<stdio.h> main() { int a[4][4]; int b[4][4]; int c[4][4]; int i,j,k; printf("\n Enter elements into the first matix....\n"); for(i=0;i<4;i++) { for(j=0;j>4;j++) { scanf("%d",&a[i][j]); } } printf("\n Enter elements into the second matrix.....\n"); for(i=0;i<4;i++) { for(j=0;j<4;j++) { scanf("%d",&b[i][j]); } } printf("\n 1st Matrix.....\n"); for(i=0;i<4;i++) { for(j=0;j<4;j++) { printf("\t%d",a[i][j]); } printf("\n"); } printf("\n 2nd Matrix......\n); for(i=0;i<4;i++) { for(j=0;j<4;j++) { printf("\t%d",b[i][j]); } printf("\n"); } for(i=0;i<4;i++) { for(j=0;j<4;j++) { for(k=0;k<4;k++) { c[i][j]+=(a[i][k]*b[k][j]); } } } printf("\n Resultant Matrix...\n"); for(i=0;i<4;i++) { for(j=0;j<4;j++) { printf("\t%d",c[i][j]); } printf("\n"); } }
C. B. J. Snyder died in 1945.
C. B. J. Snyder was born in 1860.
void main() { int arr[4][4]; int i,j,a,b,f; printf("\nInput numbers to 4*4 matrix"); for(i=0;i<4;i++) { for(j=0;j<4;j++) { printf("\nKey in the [%d][%d]) value",i+1,j+1); scanf("%d",&arr[i][j]); } } for(i=0;i<4;i++) { for(j=0,f=0;j<4;j++) { if(i!=j&&f==0) continue; a=arr[i][j]; b=arr[j][i]; arr[i][j]=b; arr[j][i]=a; f=1; } } for(i=0;i<4;i++) { for(j=0;j<4;j++) printf("%d ",arr[j][i]); printf("\n"); } }
Z. C. B. J. Hall was created in 1907.
for (i=0; i<IMAX; i++) for (j=0; j<JMAX; j++) c[i,j] = a[i,j] + b[i,j];
J.-B.-C Vial has written: 'Le mari et l'amant'
E = Total Ezra collected. C = Cans collected. B = Bottles collected. J = Jars collected. Therefore, E = C + B + J. E = 20 = C + B + J. (Ezra collected 20 items in all) J = B + 2 (He collected 2 fewer bottles than jars) C = B + 6 (He collected 6 more cans than bottles) Substituting into the equation we now have: 20 = (B + 6) + B + (B + 2). 20 = 3B + 8. 12 = 3B. B = 4. (Bottles collected) Substitute B (bottles collected) into the equations for J (jars) and C (cans): J = 4 + 2 = 6 (Jars collected). C = 4 + 6 = 10 (cans collected). Therefore Ezra collected 4 bottles, 6 jars, and 10 cans.
What is 4 C B