Missing the inclusion of appropriate header file in c program will generate an error. Such a program may compile but the linker will given an error message as it will not be able to find the functions used in the program.
Semoclone ( ; ) is one of the best sensitive symbols in programming. Placing a semicolon ( ; ) after the WHILE or FOR loop is not a syntax error. So it will not be reported by the compiler. However, it is considered to be a logical error as it change
Not putting // before the start of single statement comment is a compiler error. Not putting the */ after the termination of block comment is a compiler error.
When you are using SWITCH case, it is important to keep in mind that the inclusion of DEFAULT LABEL. This will inform you whether you are executing your program in right or wrong way. So, it is always recommended to use DEFAULT LABEL in the SWITCH st
Specifier is a typedef-name and a very sensitive in C programming. Using an incorrect specifier for the data type being read or written will generate a run time error.
// AHF C PROGRAM SOLVING //solving here 2_D ARRAY programming problemOUTPUT:
#include<stdio.h> #include<math.h> #define pf printf int main() { int marks[2][2],i,j; // declaring a two dimensional array pf("\nEnter a 2x2 matrix: "); for(i=0;i < 2;i++) for(j=0;j < 2;j++) scanf("%d",&marks[i][j]); pf("\nThe given matrix is: "); for(i=0;i < 2;i++) { pf("\n"); for(j=0;j < 2;j++) pf("%d\t",marks[i][j]); } return 0; }
Enter a 2x2 matrix: 4 5 5 5 The given matrix is: 4 5 5 5