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 |
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,
prog. to produce 1 2 3 4 5 6 7 8 9 10
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
why the range of an unsigned integer is double almost than the signed integer.
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
main() { int i=5; printf(“%d”,i=++i ==6); }
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }
create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00