+ 1

I have one question

#include <stdio.h> int main() { int x; float num; char text[20]; scanf("%d %f %s", &x, &num, text); } The above code I got in this app in input and output but it is not working. What is mistake there?

26th Nov 2020, 6:34 AM
Vipul Rohit
Vipul Rohit - avatar
7 Answers
0
You are welcome, bro!
26th Nov 2020, 6:50 AM
Angelo
Angelo - avatar
+ 2
There is no output, you forgot the printf
26th Nov 2020, 6:37 AM
Angelo
Angelo - avatar
0
But I not wrote this code. I m beginners. This is just in learning session. I can't edit it.
26th Nov 2020, 6:38 AM
Vipul Rohit
Vipul Rohit - avatar
0
The code just takes an input of int, float, string. When the code runs you are supposed to write 2 numbers and a word, than the program will end.
26th Nov 2020, 6:43 AM
Angelo
Angelo - avatar
0
And why there is not "return0;" at the end?
26th Nov 2020, 6:44 AM
Vipul Rohit
Vipul Rohit - avatar
0
In the main function the return statement is not required ( but that is not a good practice). The program will just end with an undefined return
26th Nov 2020, 6:48 AM
Angelo
Angelo - avatar
0
Okay, bro! I understood.Thanks for your time!
26th Nov 2020, 6:49 AM
Vipul Rohit
Vipul Rohit - avatar