Computer Science, asked by TbiaSamishta, 1 year ago

Will the following program work? If not State errors and correct them?>
#include
main () { printf("How many person !");}

Answers

Answered by Legionslayer2122002
0

Is the programming language C++? If yes, then reply yes... I'll send you the corrections


Legionslayer2122002: Hey Samishta, also tell me if the other answer is correct or not
Answered by Secondman
0

"No, the program will not work.

There are mainly two errors in the given code. The compiler will report both errors which are syntax errors, during the process of compilations.

The first error is that nothing is included after writing the #include statement and inside the main function, the printf() function is giving output. The printf() function exists inside the stdio.h header file, so it is important to import stdio.h for using the printf() statement.

Secondly, the main() function does not have any return type written before it. At least void type should be written if the function is not returning anything."

"No, the program will not work.

There are mainly two errors in the given code. The compiler will report both errors which are syntax errors, during the process of compilations.

The first error is that nothing is included after writing the #include statement and inside the main function, the printf() function is giving output. The printf() function exists inside the stdio.h header file, so it is important to import stdio.h for using the printf() statement.

Secondly, the main() function does not have any return type written before it. At least void type should be written if the function is not returning anything."

Similar questions