puzzle on C programming language---part 2 Online Test

main()

{

int x=5;

clrscr();

for(;x==0;x--) {

printf("x=%d\n”", x--);

}

}


main()

{

int i =10, j = 20;

clrscr();

printf("%d, %d, ", j-- , --i);

printf("%d, %d ", j++ , ++i);

}


main()

{

int c = 5;

printf("%d", main||c);

}


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);

}


main()

{

char *a = "Hello ";

char *b = "World";

clrscr();

printf("%s", strcat(a,b));

}


const int perplexed = 2;

#define perplexed 3

main()

{

#ifdef perplexed

#undef perplexed

#define perplexed 4

#endif

printf("%d",perplexed);

}


main()

{

int i, j, *p;

i = 25;

j = 100;

p = &i; // Address of i is assigned to pointer p

printf("%f", i/(*p) ); // i is divided by pointer p

}


main(int argc, char *argv[])

{

(main && argc) ? main(argc-1, NULL) : return 0;

}


main()

{

int i = 0xff ;

printf("\n%d", i<<2);

}


#define SQR(x) x * x

main()

{

printf("%d", 225/SQR(15));

}












































































Description:

hi there..here i have added some more problems....if u have any doubts please ask ...i will give a well defined explanation ....in case if u know the reason for any particular puzzle please post that too..so that other may get benefits from u..thank you all
with regards
sana

Discussion

sai

Hi,
Can u explain q10 of part -2

3059 days 10 hours 14 minutes ago

abhinav

ur answer of ques no 7 is wrong.u r dividing the i by *p not p(careful look)divide operation is prohibited on pointers not its value.so the answer would be 1.000000.

3221 days 8 hours 6 minutes ago

saobang972

Plz write you code more clearly. thank your

3251 days 13 hours 57 minutes ago

Gethzia

can u explain 2nd que..?

3372 days 15 hours 36 minutes ago

pooja

can u explain q7 of this test??

3413 days 7 hours 38 minutes ago

59 Followers

Your Facebook Friends on WizIQ

More Tests By Author

puzzle on C Programming language--Part 3
5 Questions | 543 Attempts

puzzle in C Programming Language
8 Questions | 7106 Attempts

Explore Similar Courses