can anyone explain about this warning? [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

can anyone explain about this warning? [SOLVED]

I have made a c program in which I get some warnings after output please explain it because I can't understand . And why I can't use void main() instead of int main() in SL. https://code.sololearn.com/cIDBQWGWMn6l/?ref=app https://www.sololearn.com/post/246721/?ref=app

19th Feb 2020, 2:36 AM
ihshu💞
ihshu💞 - avatar
4 Answers
+ 4
As far as void main() query is concerned then generally in morden day compilers, Return type of main() is used as exit code of the program (zero means program executed without any errors). So main has to return an integer hence int main()
19th Feb 2020, 2:50 AM
Arsenic
Arsenic - avatar
+ 3
See this code. You need initialize  your variable. https://code.sololearn.com/c0hSwvvRwIz0/?ref=app
19th Feb 2020, 2:44 AM
Pedro H.J
Pedro H.J - avatar
+ 2
Vaibhav You are trying to display 'c' before geting input from user so 'c' is an uninitialised variable here check this out👇 https://code.sololearn.com/clCnVs2wYcM6/?ref=app
19th Feb 2020, 2:42 AM
Arsenic
Arsenic - avatar
+ 2
Solved , thanks
19th Feb 2020, 2:49 AM
ihshu💞
ihshu💞 - avatar