main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Answer / susie
Answer :
infinite loop
Explanation
The difference between the previous question and this
one is that the char is declared to be unsigned. So the i++
can never yield negative value and i>=0 never becomes false
so that it can come out of the for loop.
Is This Answer Correct ? | 7 Yes | 0 No |
writte a c-programm to display smill paces
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,
main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10
How do you write a program which produces its own source code as its output?
main() { 41printf("%p",main); }8
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
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)
main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }