-
-
-
-
-
-
-
-
-
-
}
">Vii)7. main(){ int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m);}
0 0 1 3 1Explanation :Logical operations always give a result of 1 or 0 . And also the logical AND (&&) operator has higher priority over the logical OR (||) operator. So the expression ‘i++ && j++ && k++’ is executed first. The result of this expression is 0 (-1 && -1 && 0 = 0). Now the expression is 0 || 2 which evaluates to 1 (because OR operator always gives 1 except for ‘0 || 0’ combination-...
-
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
}
">Ix) main(){ int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
threeExplanation :The default case can be placed anywhere inside the loop. It is executed only when all other cases doesn't match.
-
-
-
-
-
Write a program to print the given integers in the corresponding wordings?
Say for eg. if 123 is given as input the output should be displayed as
-
}
void func2(int a[][10])
{
printf("Will this work?");
}
main()
{
int a[10][10];
func1(a);
func2(a);
}
">Void func1(int (*a)[10]){ printf("Ok it works");}void func2(int a[][10]){ printf("Will this work?");} main() { int a[10][10]; func1(a); func2(a);}
A) Ok it worksWill this work?B) Will this work?C) Ok it worksD) None of the above
-
-
-
What would be the output of the following program? main() { int y=128; const int x=y; printf("%d",x); }
A) 128B) Garbage valueC) ErrorD) 0
C Interview Questions
Ans