#define clrscr() 100

main()

{

clrscr();

printf("%d\n",clrscr());

}

Answers were Sorted based on User's Feedback



#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr..

Answer / susie

Answer :

100

Explanation:

Preprocessor executes as a seperate pass before
the execution of the compiler. So textual replacement of
clrscr() to 100 occurs.The input program to compiler looks
like this :

main()

{

100;

printf("%d\n",100);

}

Note:

100; is an executable statement but with no
action. So it doesn't give any problem

Is This Answer Correct ?    44 Yes 2 No

#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr..

Answer / naveen

yes it works and prints 100 because we defined clrscr() to
100. we can also set values to any predefined functions

Is This Answer Correct ?    20 Yes 1 No

Post New Answer

More C Code Interview Questions

int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }

1 Answers  


1) int i=5; j=i++ + i++ + i++; printf("%d",j);This code gives the answer 15.But if we replace the value of the j then anser is different?why? 2)int i=5; printf("%d",i++ + i++ + i++); this givs 18.

8 Answers   IBPS, Infosys, TCS,


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }

1 Answers   Zoho,


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,






main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,


main() { printf("%d", out); } int out=100;

3 Answers  


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


void main() { int i=5; printf("%d",i+++++i); }

3 Answers  


main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above

3 Answers   HCL,


why nlogn is the lower limit of any sort algorithm?

0 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4

2 Answers   HCL,


Categories