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 |
main() { char a[4]="HELL"; printf("%s",a); }
void main() { static int i=i++, j=j++, k=k++; printf(āi = %d j = %d k = %dā, i, j, k); }
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
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
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
Develop a routine to reflect an object about an arbitrarily selected plane
Is this code legal? int *ptr; ptr = (int *) 0x400;
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
void main() { int i=5; printf("%d",i++ + ++i); }