What will be the ouput of the following program.,if any error what is it.#includevoid main(){float x=90.5,y=5.0,z;z=x%y;printf("%f",z);}

Questions by pavankishore   answers by pavankishore

Showing Answers 1 - 36 of 36 Answers

me

  • Jan 15th, 2007
 

The return type must not necessarily be an integer.  The run-time environment will usually convert it to an appropriate type if needed.   A return type of void for main is acceptable.

  Was this answer useful?  Yes

anurag

  • Jan 23rd, 2007
 

there are2 errorsfirst with include there must be file name,,,,,,second % operator can be used only with integral values and not with float...........returning void is not an error . , main can also have void return type

  Was this answer useful?  Yes

RDX

  • Feb 2nd, 2007
 

void main() works only in windows. Try it in linux or other unix flavours and see how it throws error!

  Was this answer useful?  Yes

Ram

  • Feb 17th, 2007
 

Hey it will produce 2 errors....

1. Include file is missing.

2.% must not be used in float.

  Was this answer useful?  Yes

gaurav_gangwar9

  • Mar 17th, 2007
 

Hi Friends, Sudarshanpv is correct

  Was this answer useful?  Yes

ardashev

  • Nov 17th, 2007
 

void main() is not an error - just a warning  on linux Fedora 7:

brainbenchC.c:283: error: invalid operands to binary %
brainbenchC.c:101: warning: return type of ‘main’ is not ‘int’

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions