program structure c programming Hindi tutorials

Program structure c programming Hindi tutorials: aaj hum ish tutorial me c program ke structure ke bare me padenge. aaj hum program ke basic structure ke bare me samjenge. or dekhenge ki ek c program me konse section hote hai. or yeh bhi samjenge ki in sab section ka use kyu or kab Kiya jata hai.


program structure c programming Hindi tutorials
The basic structure of c program 

Program structure c programming Hindi tutorials

Ek c program me basically 6 main sections hote hai.

  1. Documentation section
  2. Link section
  3. Definition section
  4. Global section
  5. Main section
  6. Subsection
program structure c programming Hindi tutorials
sections

Documentation Section

Decumentation section vo section hota hai jisme user program ka documentation likhta hai. user ish section me vo sari details likhta hai jisse ki program ko padhne vale reader ko aasani se program samaj me aa sake. ish section ko comments ke tor par likha jata hai. ish section ko compiler compile nahi karta hai. ish section me user koi bhi detail de skta hai jo ki ushe important lagti hai.

Note: aage ke tutorials me hum c program me comment kaise likhte hai yeh janege. abhi ke liye aap bus yahi samaj lijiye ki documentation section me sirf comments likhe jate hai.


Example:

// this program is written by yash deora
/* date 10-1-2000
 * by programmingisinhindi
 * documentation
 * section */

Link Section

Link section vo section hota hai jisme user programs me header files ko link karta hai. jaisa ki hamne pichle tutorial me padha ki kaise header file kyu use ki jati hai program me.

Note: Header file ke bare me detial me samjene ke liye ish link ke upar click kare. 


Example:

#include<stdio.h>
#include<conio.h>
#include<graphics.h>

Definition Section

Definition section vo section hota hai jisme user program me constants jaise ki macros, preprocessor directories ko define karta hai.

Note: aage ke tutorials me hum macros, preprocessor or constants ko details me samjenge. 


Example:

#define X=30

Global Section

global section vo section hota hai jisme ki hum global variables define karte hai. jaise ki global constants, variables, functions etc. ish section me define variables ko kahi bhi access kiya ja skta hai.

Note: aage ke tutorials me hum global variables ke bare me details me samjenge.


Example:

int max = 30;

Main Section

main section vo section hota hai jisme ki hum main program ki coding karte hai. ek c program me main function hamesa hota hai. bina main function ke bina c program kabhi nahi ban skta hai.
compiler hamesa main function ke open curley braces se program ko compile karna start karta hai or close cruley braces par compile karna band karta hai.

Note: main function me hamesa main() function hi hota hai. hum main function ka name nahi change kar skte hai.


Example:

int main()
{
   printf("Hello c programming.");
   getch();
   return 0;
}

Subsection

Subsection vo section hota hai jisme ki hum other function ko define karte hai program me use Karne ke liye. ish section ko hum user define section bhi kehte hai.

Note: aage ke tutorials me hum user define functions ke bare me detail me samjenge.


Example:

int sum()
{
 
printf("your sum is 20");

}

Example program to define the structure of c program.

/* * this is a documentation section *
* created by programmingisinhindi
* date 10-1-2000 */

#include<stdio.h>
#include<conio.h>
//this is link section
#define X 30          //this is definition section
int add();                //global section
int main()              //main section
{
   int x;
   x = add();
   printf("Your sum is %d", add());
   getch();
   return 0;
}
int add() 
            //subsection
{
   return 10;
 }
program structure c programming Hindi tutorials 

Post a Comment

0 Comments