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.
Chat with our AI personalities
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
}
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.
no, only program statements end with a semicolon. rest all which includes definition and others dont end with a semicolon.
Yes, except for the compound statement (= block):
{ declarations; statements; } <No semicolon here>
Semicolons mark the end of C++ statements. A statement without a terminating semicolon is invalid and the program will not compile.
int main (void) { puts ("Simple, but not working program without any semicolon and header file") }
Semicolon, in some languages. Line-end in some others.
The name of the program. For example: program sum ! This is a comment. Your program's code goes here... end program sum
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.
in C: a semicolon in itself. Examples:1. while (*to++ = *from++);2. { goto END; ... END:; }
For clasesses it defines from which class to inherit. :: means area of visibility in certain name space.