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 |
main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }
how to check whether a linked list is circular.
Write a single line c expression to delete a,b,c from aabbcc
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
find simple interest & compund interest
write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??
Is it possible to type a name in command line without ant quotes?
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.
21 Answers ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,