0
What should I do to return 1
#include <stdio.h> void main() { int i=5; int j=7; int k=i+j; printf(s) ; return 1; }
12 odpowiedzi
0
Ajoh Pv becz each language has its own features and rules c/cpp main function and java main function have difference . Becz in java we writing
public static void main
Here return type is void that's why we cannot use int . But yeah when you creating methods then you can use return statements .
+ 4
return int in main().
+ 1
Ajoh Pv only execution start from main function
This is function decleration
void add();
This is definition
void add()
{
}
This is calling
add();
+ 1
Userdead #thanku
0
Go back to C course, and check the topic with printf(), cuz it looks like you don't know how to use it
0
Michael doruch thanks you are right, can u say what is calling function example, is it always main
0
User dead can you say why return 0 is not there in java
0
A. S where are you❓ from
0
Ajoh Pv I am from IT world
0
U mean java has rules that is why it return s valid return type even though void
0
Ajoh Pv as in main function its compulsory to write void if u will study starting of java in books or from any tutorials. You will understood better why we using void why not int .
0
Thanks indian