What is the output of the program given below
main()
{
signed char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Answer / susie
Answer :
-128
Explanation
Notice the semicolon at the end of the for loop. THe initial
value of the i is set to 0. The inner loop executes to
increment the value from 0 to 127 (the positive range of
char) and then it rotates to the negative value of -128. The
condition in the for loop fails and so comes out of the for
loop. It prints the current value of i that is -128.
Is This Answer Correct ? | 2 Yes | 1 No |
String reverse with time complexity of n/2 with out using temporary variable.
Write a function to find the depth of a binary tree.
13 Answers Adobe, Amazon, EFI, Imagination Technologies,
main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }
main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }
void main() { int i=i++,j=j++,k=k++; printf(ā%d%d%dā,i,j,k); }
writte a c-programm to display smill paces
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
write a program to Insert in a sorted list