I am using Dev c++ as IDE and I am a student and new here
I am trying out to see what values the program give so when ever i was putting
float main()
and return some float value it is giving some long integer numbers
and when i put nothing liKe
main()
it is simply returning some integer value
why is that any particular reason ?
Thanks in advance
Asked
Active
Viewed 100 times
0

drescherjm
- 10,365
- 5
- 44
- 64

anvesh mydg
- 21
- 4
-
Answer http://stackoverflow.com/a/207992/2410359 well explains the C issues. – chux - Reinstate Monica Sep 08 '15 at 15:04
1 Answers
2
The main function is called by the operating system and the return value you're seeing is mainly returned to the operating system. If you can put your code and what you'd like to see we might be able to help a little bit more. Also there are several links you can follow for this. Take a look at this What should main() return in C and C++?

Community
- 1
- 1

sammyukavi
- 1,501
- 2
- 23
- 51
-
If you find a duplicate for a question flag it as duplicate instead putting the link in an answer pleas. – πάντα ῥεῖ Sep 08 '15 at 15:05
-
float main() { return 5.6; }this is giving a return value of 1085485875 is there a particular reason? – anvesh mydg Sep 08 '15 at 15:07