Comments C programming Hindi tutorials

Comments C programming Hindi tutorials: Aaj ke ish tutorial me hum c programming me comments ke bare me padhenge. or yeh dekhenge ki program me comments ko kyu or kaise likha jata hai. 
Comments C programming Hindi tutorials
Comments

Comments C programming Hindi tutorials

Comments Definition:

Comments vo lines hoti hai jo ki actual program ke output ko effect nahi karti hai. comments compiler ke dware compile nahi Kiya jata hai. yeh, code ke actual meaning ko nahi badalta hai. 

Hum program me comments ko is liye likhte hai. taki jab bhi hamara code koi person padhe tab vo person hamare code ko aasani se samaj sake. comments me hum message, user's profile or code ka documentation yeh sab likh skte hai. comments ko hum jab chahe or jaha chahe likh skte hai.


Program me comments ko likhne ke 3 tarike hai. 

  • Single line comment
  • Multiple line comment
  • Using preprocessor

Single line comment 

Single line comment ko likhne ke liye hame sabse pahle 2 forward slashes // ka use Karna padta hai. 

Syntax:
//comment message
Example:
//This is a comment section

Note: jab bhi hum single line comment ka use karte hai tab hum comments ko ek line me hi likhte hai. 


Multiple line comment

Multiple line comments ko likhne ke liye hame sabse pahle ek forward slash or asterisk ka sign Lagna hota hai /* or iske baad hum apne comment ko likhte hai. or baad me hum apne comment ko band karne ke liye ek asterisk or forward slash */ ka istemal karte hai. 

Syntax:

/* comment or message ..
 .............................
the end line of comment   */

Example:

/* this is the comment section
and this is the multiple lines 
comment section ....... */

Using preprocessor

Jab bhi hum koi bada comment likhte hai tab hum preprocessor ka use karte hai comment ko likhne ke liye. is method ka use hum generally nahi karte hai. bas Maine aapko yeh method Sirf knowledge ke liye bataya hai.
Syntax:

#if 0 comment 
commen 
comment  #endif
Example:

#if 0 this is comment
using the preprocessor 
directories .......... #endif
Example Program 

// Printf("this is single-line comment ");
/ * printf("this is the multiple 
    line comment */

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

int main()
{
    printf("\nThis is an example program to learn about the commenting in the program");
    getch();
    return 0;
}
Output:

This is an example program to learn about the commenting in the program

agar aapko yeh knowledge acha laga toh ish knowledge ko jayada se jayada share kare. or kisi bhi question ye aapke dil me koi bhi sujaav he to aap niche diye gaye comment box me jarur likhe.

Post a Comment

0 Comments