main()

{

char c;

int i = 456;

clrscr();

c = i;

printf("%d", c);

}

a. 456

b. -456

c. random number

d. none of the above

Answers were Sorted based on User's Feedback



main() { char c; int i = 456; clrscr(); c = i; printf("%d"..

Answer / guest

d) -56

Is This Answer Correct ?    23 Yes 5 No

main() { char c; int i = 456; clrscr(); c = i; printf("%d"..

Answer / satya

ans: -56
explanation:
it mainly focus on integer range
it will prints the output like this
for 1=1
2=2....127=-127,
128=-128,
129=-127....256=0;
similarly
456 means 256+256=512=0;
456-512=-56

Is This Answer Correct ?    10 Yes 2 No

main() { char c; int i = 456; clrscr(); c = i; printf("%d"..

Answer / karthi

d.none of the above

Is This Answer Correct ?    8 Yes 2 No

Post New Answer

More C Code Interview Questions

main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


main() { 41printf("%p",main); }8

1 Answers  


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

1 Answers  


how to concatenate the two strings

1 Answers  






write a program in c to merge two array

2 Answers  


main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024

2 Answers   HCL,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

2 Answers   CSS, Wipro,


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

2 Answers  


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

1 Answers  


char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

1 Answers  


int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 Answers  


Categories