answersLogoWhite

0


Best Answer

Yes, but it will be difficult, because you will need to explicitly declare any library functions and constants that you will need, and often there are many such declarations. If you are talking about a header file specific to your program, the answer is still yes; simply declare your functions and constants before you use them. This is often done in single file program that are provided on the internet - the file will contain includes for "standard" headers, but none for specific program related headers - and the order of functions will simply be backwards, with main() at the end - or the function will be declared at the top, with main() immediately after the declarations.

User Avatar

Wiki User

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

Wiki User

13y ago

Technically, yes...

int main(int argc, char *argv[])

{

}

An empty main function compiles, at least on GCC. If you define an executable file as a "program" then there you go. Also while you are going to need to use a semi colon in the file, I found this to work as well:

#include <stdio.h>

#define theEnd ;

int main ()

{

printf("Look mom, no semicolons") theEnd

return 0 theEnd

}

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

No. The semi-colon turns an expression into a statement however some expressions do not require a semi-colon to become a statement. The for loop is a typical example, where the final expression has no semi-colon:

for (int x=0; x<100; ++x)

printf ("%d\n",x);

In the above example, the ++x expression is a statement without a semi-colon.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

no, only program statements end with a semicolon. rest all which includes definition and others dont end with a semicolon.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Yes, except for the compound statement (= block):

{ declarations; statements; } <No semicolon here>

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include<stdio.h>

main()

{

if(printf("Hello World"))

{

}

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

Semicolons mark the end of C++ statements. A statement without a terminating semicolon is invalid and the program will not compile.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

int main (void) { puts ("Simple, but not working program without any semicolon and header file") }

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

void main()

{

if (printf("Hai"))

{ }

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include<stdio.h>

#include<conio.h>

main()

{

while(!printf("Hello"))

{}

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Does every line in C program end with a semicolon?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is statement terminator?

Semicolon, in some languages. Line-end in some others.


What is the first line of every FORTRAN program and what does it tell the compiler?

The name of the program. For example: program sum ! This is a comment. Your program's code goes here... end program sum


Every complete statement ends with a?

Any teacher will expect you to answer by saying a semicolon (;), but this is not strictly true. First of all, the definition of a "line of code" varies from teacher to teacher and textbook to textbook. Second, even the Java Language Specification lists several types of Java statements which do not need to end in a semicolon.In general, a complete Java statement will end in either of semicolon or a closing block brace.


When to use simicolon?

Semicolon is a part of punctuation used mostly in coding. It denotes the end of line in many programming languages.


Which of these terms is described as a full pause or break in the meter often followed by punctuation such as a period semicolon colon exclamation comma or dash?

A caesura is a full pause or break in the meter of a line of poetry. It is often followed by different forms of punctuation, such as a period, semicolon, colon, exclamation mark, comma, or dash.


Many versions of SQL require you to end a command with a?

semicolon (;)


What is a line segmet?

a line segment is a part of a line that is bounded by 2 end points, and contains every point on the line between its end points


Can line segments have holes or missing pieces?

No it cannot because a line segment is a part of a line that is bounded by two end points, and contains every point on the line between its end points. If it has holes it does not contain every point between the end points.


What is the definition of a line segment?

A line segment is a part of a line that is bounded by two end points, and contains every point on the line between its end points.


What is null statement?

in C: a semicolon in itself. Examples:1. while (*to++ = *from++);2. { goto END; ... END:; }


Parse error expecting semicolon or comma in PHP file?

Most lines require a semi-colon and the end. It's likely that that line does. A parse error is an error in syntax so you need to add ; at the end of the line like so:


What makes it unnecessary the enter key on the keyboard at the end of every type line?

Next Line