answersLogoWhite

0

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

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
More answers

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

}

User Avatar

Wiki User

14y ago
User Avatar

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.

User Avatar

Wiki User

9y ago
User Avatar

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

User Avatar

Wiki User

16y ago
User Avatar

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

{ declarations; statements; } <No semicolon here>

User Avatar

Wiki User

15y ago
User Avatar

#include<stdio.h>

main()

{

if(printf("Hello World"))

{

}

}

User Avatar

Wiki User

13y ago
User Avatar

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

User Avatar

Wiki User

11y ago
User Avatar

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

User Avatar

Wiki User

14y ago
User Avatar

void main()

{

if (printf("Hai"))

{ }

}

User Avatar

Wiki User

13y ago
User Avatar

#include<stdio.h>

#include<conio.h>

main()

{

while(!printf("Hello"))

{}

}

User Avatar

Wiki User

13y ago
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