main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Behavior is implementation dependent.
Explanation:
The detail if the char is signed/unsigned by default
is implementation dependent. If the implementation treats
the char to be signed by default the program will print –128
and terminate. On the other hand if it considers char to be
unsigned by default, it goes to infinite loop.
Rule:
You can write programs that have implementation
dependent behavior. But dont write programs that depend on
such behavior.
| Is This Answer Correct ? | 5 Yes | 2 No |
How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
main() { printf("%d", out); } int out=100;
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0
write a c program to Reverse a given string using string function and also without string function
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }
what is the code of the output of print the 10 fibonacci number series
main() { int c=- -2; printf("c=%d",c); }