main()

{

float f=5,g=10;

enum{i=10,j=20,k=50};

printf("%d\n",++k);

printf("%f\n",f<<2);

printf("%lf\n",f%g);

printf("%lf\n",fmod(f,g));

}



main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); prin..

Answer / susie

Answer :

Line no 5: Error: Lvalue required

Line no 6: Cannot apply leftshift to float

Line no 7: Cannot apply mod to float

Explanation:

Enumeration constants cannot be modified, so you cannot
apply ++.

Bit-wise operators and % operators cannot be applied on
float values.

fmod() is to find the modulus values for floats as %
operator is for ints.

Is This Answer Correct ?    11 Yes 5 No

Post New Answer

More C Code Interview Questions

Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


write a c-program to display the time using FOR loop

3 Answers   HCL,


code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123

1 Answers   HCL,


&#8206;#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  






main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  


Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


why java is platform independent?

13 Answers   Wipro,


what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 Answers  


Categories