Basics of C-programming

Nitish Roy
Sep 7, 2018 · 1 min read

This is my first blog for prayas.

I don’t consider myself as a great programmer,but i know well to give you the basic goosebumps..

The first C-program

#include<stdio.h>//1
int main(int argc, char* argv[])//2 (//3,//4)
{
printf("hello world,calling from main");
return 0; //6
}

so, in the code above,,

1. #include<stdio.h>

with #include<some_header_file.h>, we include the c programs which are already pre-written in the stdio.h file,,

stdio -> standard input/output,

this header file contains all the functions required for input and output,for example:

printf() //used to print something.

scanf() //used to get the values into variables.(we will get into this later in much detail)

2.3.4.int main(int argc,char* argv[]){

// something-something

}

So here, main is a function,and in many way it is similar to functions that you have studied in mathematics in class 11 and 12.

in the code above main in mathematical form y=f(x,z) as y is of type int x is int argc and z is char* argv[] (sounds complex,not when you see its implementation)..

so in int main(int argc,char* argv[]), int is the return type,argc and argv are the argument, main is the name of the function,,

Task -> in the code above search for an another function.

6.return 0;

as main functions return 0;

Nitish Roy

Written by

A Full Stack Developer.Framework specialisation:Flask.An Android Developer.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade