answersLogoWhite

0


Best Answer

Simply print a new line before invoking any return statement within the main function:

#include<stdio.h>

int main(void) {

// ...

printf ("\n"); // print a new line to the stdout device

return 0; // end the program (0 typically indicates no error)

}

User Avatar

Wiki User

7y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

7y ago

A C program ends when a return statement is encountered within the main function, or when either the exit() or abort() function is invoked. One or other function is invoked implicitly when an unhandled exception occurs because C does not support exception handling. In multi-threaded C applications, it is vital that all threads of execution are explicitly terminated before the main function terminates.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you end the c program with a new line?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

A new programmer whom you are training is writing a C program and wants to place comment lines in the program what characters should be used at the beginning and end of the comments?

if single line comment just place // before for single line comment else if multiple line denote as like this /*............................. ..............................*/ Strictly speaking, // is non.standard in C only in C++


C program to Draw a line chart?

draw a line chart.


How do you skip a line in C program?

putchar ('\n');


How do you write a programme in c?

Basic Program in "C" #include &lt;stdio.h&gt; /*This is the standard input/output library function*/ main(void) /*All C programs must have the function main*/ { char ch; printf("This is a C Program."); /* Every line of code in C must end with a semi colon*/ printf("Welcome to C!");/*the printf outputs the line of text to the screen*/ scanf("%c%c", &amp;ch, &amp;ch); /* This is a trick way to pause the computer so you can read the information on the screen*/ return 0; /* Indicates that your program has terminated successfully*/


Can comments be longer than one line and if yes how?

C++ also supports C program's multiple command line /* your command */.


Without using a semicolom you can print any charectar in c language?

how can we print without using semi coloum semi coloum ina c program is used to indicate the end of a line......without ; at end the compiler cannot proceed to next step


How do you end a program in c?

All C programs have a main() function, and when the end of that is reached, the program terminates, so to end a program, just type the ending curly bracket '}' to match the opening one of the main() function. It is considered good practice to end a program with the statement 'return 0;' before the last curly bracket, to indicate that the program terminated normally.


Write c programs to display 10 line biodata?

A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.


What key moves the cursor to the next line in c program?

The return key.


Definition of comments in c plus plus?

In C++, you can write comments two different ways. The old way, which is C compatible, is to bracket the commented text with /* and */. These comment operators extend across lines. The new way, for C++, is the single line comment. You start the comment with //, and everything from that point to the end of the current line is a comment.Note: You can use the preprocessor as well:#if 0Many many lines of comments#endif


What is the difference between compilers and interpreters in c plus plus in tabular form?

C-compiler translates the C-source into Assembly or machine code. On the other hand, C-interpreter -- well, there is no such thing as C-interpreter.


__PROGRAM?

AI Program (artificial intelligence) maybe?