#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],r,c;
for(r=0;r<=3;r++)
{
for(c=0;c<3;c++)
{
printf("\n enter the value=");
scanf("%d%d",&a[r][c],&b[r][c]);
}
}
printf("\n first matrix=\n");
for(r=0;r<=3;r++)
{
for(c=0;c<3;c++)
{
printf("%d\t",a[r][c]);
}
printf("\n");
}
printf("\n scond matrix=\n");
for(r=0;r<=3;r++)
{
for(c=0;c<3;c++)
{printf("%d\t",b[r][c]);
}
printf("\n");
}
printf("\n sum of given matrix=\n");
for(r=0;r<=3;r++)
{
for(c=0;c<3;c++)
{
c[r][c]=a[r][c]+b[r][c];
printf("%d\t",c[r][c]);
}
printf("\n");
}
getch();
}
This is a directive, not a question.
//the following code will help you to write the program for(i=n-1, j=0; i > 0; i--, j++) //n is the order of the square matrix { for(k=j; k < i; k++) printf("%d ", a[j][k]); for(k=j; k < i; k++) printf("%d ", a[k][i]); for(k=i; k > j; k--) printf("%d ", a[i][k]); for(k=i; k > j; k--) printf("%d ", a[k][j]); } m= (n-1)/2; //calculate the position of the middle element if (n% 2 == 1) printf("%d", a[m][m]);//to print the middle element also //9809752937(udanesh)
Yes but why.
echo 'print a pattern'
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
#include <stdio.h> #include <conio.h> void main() { int d[3][3] = { 1, 2, 6, 3, 8, 5, 5, 6, 7 }; int k = 0, j = 0; int sum1 = 0, sum2 = 0; for (j = 0; j < 3; j++) { for (k = 0; k < 3; k++) printf(" %3d", d[j][k]); printf("\n"); } for (j = 0; j < 3; j++) { sum1 = sum1 + d[j][j]; } k = 3 - 1; for (j = 0; j < 3; j++) { if (k >= 0) { sum2 = sum2 + d[j][k]; k--; } } printf("Sum of First diagonal= %d\n", sum1); printf("Sum of Second diagonal= %d", sum2); getch();
This is a directive, not a question.
http://www.assignmentsclub.com/
how do you erase dot matrix print form paper
A basic dot matrix has 9 pins, which produces an average print. A dot matrix with 24 pins (or more) will produce a better quality print.
dot matrix
//the following code will help you to write the program for(i=n-1, j=0; i > 0; i--, j++) //n is the order of the square matrix { for(k=j; k < i; k++) printf("%d ", a[j][k]); for(k=j; k < i; k++) printf("%d ", a[k][i]); for(k=i; k > j; k--) printf("%d ", a[i][k]); for(k=i; k > j; k--) printf("%d ", a[k][j]); } m= (n-1)/2; //calculate the position of the middle element if (n% 2 == 1) printf("%d", a[m][m]);//to print the middle element also //9809752937(udanesh)
Yes but why.
A line printer and dot matrix printer differ in how they print pages. Line printers are more commonly used with computers, while dot matrix printers function similarly to a typewriter.PrintingA line printer print pages exactly as its name implies, one line at a time. Dot matrix printers use pins arranged in a matrix that physically strike an ink ribbon between the pin and the paper to print characters.SpeedLine matrix printers can print roughly 1,200 lines per minute, or generally about 20 pages per minute. Dot matrix printers print about 40-300 characters per second, or about six to seven pager per minute, at best.QualityDot matrix printers have a lower print quality than line printers. The characters' shapes on pages printed using a dot matrix printer appear as a number of dots connected together. Line printers print solid characters and can use a wide variety of font face and sizes.
echo 'print a pattern'
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
write a program to print A to Z on screen in c?