main()
{
char a[4]="HELLO";
printf("%s",a);
}
Answers were Sorted based on User's Feedback
Answer / dani
Actually I compiled this and ran it unix and it just prints out a warning, not an error:
"warning: initializer-string for array of chars is too long"
The programme prints the initial array without the last character (because of the '\0' special character):
"HELL �"
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / susie
Answer :
Compiler error: Too many initializers
Explanation:
The array a is of size 4 but the string constant requires 6
bytes to get stored.
| Is This Answer Correct ? | 2 Yes | 2 No |
write the function. if all the character in string B appear in string A, return true, otherwise return false.
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(ā%dā, i); }
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
what is oop?
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }