Basic Syntax of C: Basically the C program is starting from “main()” and the whole programming is done inside the two curly braces after main. You can write this as
void main () { }
OR
void main(){
}
OR
void main()
{
}
Before main() we always write some return type void , int, float, double, char as shows in above example void is used. We will discuss later on about return type because it can be better understand after chapter Function..
Basic program in C: Try to run the below program. Here in this program we are printing Hello World! By using printf(“”); function anything written in between double quotes“ ” is printed on output screen.
#include <stdio.h>
void main() {
printf(“Hello World!”); }
Comments
Post a Comment