main( )
{
int a[ ] = {10,20,30,40,50},j,*p;
for(j=0; j<5; j++)
{
printf(“%d” ,*a);
a++;
}
p = a;
for(j=0; j<5; j++)
{
printf(“%d ” ,*p);
p++;
}
}
Answer / susie
Answer :
Compiler error: lvalue required.
Explanation:
Error is in line with statement a++. The operand must be an
lvalue and may be of any of scalar type for the any
operator, array name only when subscripted is an lvalue.
Simply array name is a non-modifiable lvalue.
Is This Answer Correct ? | 9 Yes | 1 No |
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
Find the largest number in a binary tree
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
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
Write a function to find the depth of a binary tree.
13 Answers Adobe, Amazon, EFI, Imagination Technologies,
main() { printf("%d", out); } int out=100;
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 i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange