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 |
writte a c-programm to display smill paces
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
how can u draw a rectangle in C
53 Answers Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
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; }
Find the largest number in a binary tree
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
How we print the table of 2 using for loop in c programing?
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above
4 Answers Corporate Society, HCL,
plz send me all data structure related programs