Wednesday, 31 October 2012

C programming Quiz 31-35

C programming Quiz 31-35


Quiz 31:
main()
{
static int x=190;
static int y=x;
if(x==y)
printf("equal");
else
printf("unequal");
return 0;
}




Quiz 32:
int increment(int i)
{
i++;
return i;
}
int main()
{
int i;
for(i=0;i<10;increment(i)) printf("%d",i); getch(); }



Quiz 33:
What are the total number of keywords in C?

30
33
32
35



Quiz 34:
What is the output of following program? Assume that stack grows towards lower addresses. Also assume that variables are pushed on to the stack in the order in which they are declared.

main()
{
int x, y;
int *p1 = &x;
int *p2 = &y;
printf("%d\n", p1-p2);
}




Quiz 35:

main()
{
int x = 10;
int y = 20;
if (x <= y == 1) { ++x; } printf("%d\n", x); }


In case of any explanation kindly comment! DON'T FORGET TO JOIN THIS BLOG.. SHARE IT WITH YOUR FRIEND!

No comments:

Post a Comment