Learn c++ programming For free - updateTECHn.

What is c language?| C language programs | C programming.

 

C language is considered to be the most powerful programming language in today's time. As you know that many years ago people didn't know about C language, but as technology developed, people started showing their interest in programming languages.

Today this article will be told about C language, what is C language, who has developed C language etc. Which language has been made from C language?

C language is considered as a simple programming but it is not like that at all, from C language you do not know that C language has created all the software and programming languages.

 

Also Read:-

1.   How to fix create an ads.txt file for 1 site | Earnings at risk in adsense.

2.   Earn with Pexel - Earn $150 a day on your phone.

3.   Complete Information About nft | non fungible tokens Meaning in hindi.

4.   Ghar bethe Online paise kaise kamaye – मोबाइल से पैसे कैसे कमाए 2022.

If you take the subject of C language after 10th class, then you can get a chance to learn and understand C language. C language will be taught in professional courses like BCA, BBA etc.

Introduction of C language.

The C language is a highly portable and common-motive programming language developed by Dennis Ritchie at Bell Labs in 1972.

 

C language programs : write in turbo c 





output



C program syntax


                        
 
   

Header file 

The Header file is a file which is the function of declaring the C function and which Tell between the middle Various file and the header file are of two types.


The first person who writes this system and the second who works with the compiler supply file.

Header always declare with pre-processive directive '#'.

 


Main function

The main feature is a start line of the programmer who controls the govt through directing the call inside the program. This is likewise know as access factor of this system.

Main Function are usually with parentheses '()' and finishing with ';'

 




Difference of void main() and int main()


Input Function 

The Input function asks the consumer to jot down some thing and the person who desires to reveal it inside the application asks to write which he sees on the display whilst output.

Input function Every inquire the user in the program.


Output function 

Output is the characteristic that is written within the application thru which the code written by the programmer can display itself on the display.

Output function are always show before compilation.





Return function 

In C language, work return Means the worth returned opposite a carrying finishes its execution and ways out.

Return Function are continually with parentheses '()' and ending with ';' .


Compiler (alt + f9)

The compiler is a  converts the source file into the object file.

Run(Ctrl + f9)

The processor can get this .exe record content with the goal that it can play out the assignment determined in the source document. We utilize an alternate route key Ctrl + F9 to run a C program. At whatever point we press Ctrl + F9, the .exe record is submitted to the central processor.

Identifier

All c program language period variable have to be identifier with precise name this unique call is called identifier


Rules of naming identifier


Constant

A Constant is a cost that can not be changed by means of the program in the course of normal execution i.E. The value is a Constant.

Types of Constant


Comment in C program

comment is a something like notes in the C language and compiler cannot read the comment. Comments are enhancing the stability and readability of the function under code.

There are two types of comment

1.Single line comment '/'


Ex.- /single line comment/

2. multi line comment '*/         /*'


Ex.-  */multi 
           line 
           comment/*


Control structure in C

Sequence Structure

Simple Programming without using any control statement.


Selection Structure

If-else ; Switch case

If-else ; Switch case



Loop structure

For ; While ; Do-While

While and Do-while



List of easy 'C' Program


1.//hello my Crush tech


#include<stdio.h>

#include<conio.h>

void main()

{

  clrscr();

printf("hello my Crush tech");

getch();

}

-output-

hello my Crush tech


2.//printf example 

#include<stdio.h>

#include<conio.h>

void main()

{

  clrscr();

printf("welcome to you");

printf("hello my Crush tech");

printf("i am c beginner and student");

printf("please Subcribe 'Crush tech'");

getch();

}

-output-

welcome to you

hello my Crush tech

i am c beginner and SC student

please Subcribe 'Crush tech'


3.//scanf example 

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b;

float c;

  clrscr();

printf("enter the value of A=");

scanf("%d",&a);

printf("enter the value of B=");

scanf("%d",&b);

printf("enter the value of C=");

scanf("%f",&c);

printf("\n \nA=%d\nB=%d\nC=%f");

getch();

}

-output-

enter the value A=10

enter the value B=20

enter the value of C=30

A=10

B=20

C=30


-----------------------------------------------------------------------------------------------------------------------------

4.//print an integer


#include<stdio.h>

void main()

{

int a; 

clrscr();

printf("enter a integer number \n");

scanf("%d",&a);

printf("you have entered number=%d\n",a);

return 0;

}

-output-

enter a integer number 1010100

you have entered number=1010100

-----------------------------------------------------------------------------------------------------------------------------

5.//simple addition by coding

#include<stdio.h>

#include<conio.h>

void main()

{

int a=18,b=4,c; 

clrscr();

c=a+b;

printf("c=%d",c);

getch();

}

-output-

c=22

-----------------------------------------------------------------------------------------------------------------------------

6.//simple division example 

#include<stdio.h>

#include<conio.h>

void main()

{

int a=10,b=5,c

  clrscr();

c=a/b;

printf("c=%d",c);

getch();

}

-output-

c=2


-----------------------------------------------------------------------------------------------------------------------------

7.//global and local variable

#include<stdio.h>

#include<conio.h>

int x=14             /*Global variable*/ 

void main()

{

int x=23;         /*Local Variable*/

  clrscr();

printf("\n x=%d,y=%d",x,y);

getch();

return 0;

}

-output-

x=10,y=20

-----------------------------------------------------------------------------------------------------------------------------

8.//simple addition using scanf

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

  clrscr();

printf("enter the value of A=");

scanf("%d",&a);

printf("enter the value of B=");

scanf("%d",&b);

c=a+b;

printf("the result is=%d",c);

getch();

}

-output-

enter the value of A=10

enter the value of B=20

the result of=30


-----------------------------------------------------------------------------------------------------------------------------

9.//simple subtraction using scanf

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

  clrscr();

printf("enter the value of A=");

scanf("%d",&a);

printf("enter the value of B=");

scanf("%d",&b);

c=a-b;

printf("the result is=%d",c);

getch();

}

-output-

enter the value of A=20

enter the value of B=10

the result is=10


-----------------------------------------------------------------------------------------------------------------------------

10.//simple multiplication using scanf

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

  clrscr();

printf("enter the value of A=");

scanf("%d",&a);

printf("enter the value of B=");

scanf("%d",&b);

c=a*b;

printf("the result is=%d",c);

getch();

}


-output-

enter the value of A=10

enter the value of B=20

the result is=200

-----------------------------------------------------------------------------------------------------------------------------

11.//find the square root

#include<stdio.h>

#include<conio.h>

void main()

{

int a;

  clrscr();

scanf("%d",&a);


printf("square root=%d",a);

getch();

}

 

-output-

25

square root=5


-----------------------------------------------------------------------------------------------------------------------------

12.//find the area of circle

#include<stdio.h>

#include<conio.h>

void main()

{

float a,r;

  clrscr();

printf("enter the radius=");

scanf("%f",&r);

a=PI*r*r;

printf("area of circle=%2f",a);

getch();

}


-output-

enter the radius=10

area of circle=314.00

-----------------------------------------------------------------------------------------------------------------------------

13.//find the volume of cube

#include<stdio.h>

#include<conio.h>

void main()

{

int l,b,h,v;

  clrscr();

printf("enter the value of l=");

scanf("%d",&l);

printf("enter the value of B=");

scanf("%d",&b);

printf("enter the value of h");

scanf("%d",&h);

v=l*b*h;

printf(volume of cube=%d",v);

getch();

}


-output-

enter the value of  l=10

enter the value of  b=20

enter the value of  h=30

 

volume of cube=6,000

-----------------------------------------------------------------------------------------------------------------------------

14.//find the gross salary 

#include<stdio.h>

#include<conio.h>

void main()

{

int gs,bs,ta,da;      /*gs=gross salary,   da=dearess allowance,    ta=travelling allowance,     bs=basic salary*/

  clrscr();

printf("enter the value of bs=");

scanf("%d",&bs);

da=(10*bs)/100;

ta=(12*bs)/100;

gs=bs+da+ta;

printf("the total salary is=%d",gs);

getch();

}


-output-

enter the value of bs=100


the total salary is=12,200


-----------------------------------------------------------------------------------------------------------------------------

15.//find the remaining days 

#include<stdio.h>

#include<conio.h>

void main()

{

int  a,b,r;

  clrscr();

printf("enter total days=");

scanf("%d",&a);

b=a/30;

printf("month=%d",b);

r=a%30;

printf("remaining days=%d,r);

getch();

}

-output-

the total days=65

month=2

days=5

-----------------------------------------------------------------------------------------------------------------------------

16.//simple interest of calculation

#include<stdio.h>

#include<conio.h>

void main()

{

float i,p,r,n;

  clrscr();

printf("enter the value of p=\n");

scanf("%f",&p);

printf("enter the value of r=\n");

scanf("%f",&r);

printf("enter the value of n=\n);

scanf("%f",&n);

i=(p*r*n)/100;

printf("interest=%f",i);

getch();

}

-output-

enter the value of p=1200

enter the value of r=1.2

enter the value of n=3

interest=43.2

 -----------------------------------------------------------------------------------------------------------------------------

17.//find difference between in rupees and paisa

#include<stdio.h>

#include<conio.h>

void main()

{

int rup,pai;

float a;

printf("enter the total money=")

scanf("%f",&a);

rup=a;

printf("\n total rupees=%d\n",rup);

p=(a-rup)*100;

printf("total paisa=%d",pai);

getch();

}

-output-

enter the total money=12.25

total rupees=12

total paisa=25

-----------------------------------------------------------------------------------------------------------------------------

18.//swapping two number using third value

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,temp;

printf("enter the value of A=");

scanf("%d",&a);

printf("enter the value of B=");

scanf("%d",&b);

temp=a;

a=b;

b=temp;

printf("the swapping number is=%d",temp);

getch();

}

-output-

enter the value of A=12

enter the value of B=17

the swapping number is=17

12

 -----------------------------------------------------------------------------------------------------------------------------

19.//swapping number without using third digit

#include<stdio.h>

#include<conio.h>

void main()

{

int k,i;

printf("enter two digit=");

scanf("%d %d",k,i);

i=i-k;

k=i-k;

i-i-k;

printf("the result is \n i=%d\n k=%d",i,k);

getch();

}

-output-

enter two digit =45 

49

the result is=49

45

-----------------------------------------------------------------------------------------------------------------------------

20.//example of 'getchar'

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();char a,b;

printf("\n enter one character=");

scanf("%c",&a);

printf("input the character is=%c",a);

prinrf("\n\n\n Enter second character=");

getchar();

printf("value of character(%c)is=%d",b,b);

getch()

}


-output-

enter one character=r

second character=n

value of charactr(n)is=110


21.//example of  putchar


#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();char a,b;

printf("\n enter one character=");

a=getchar();

printf("Lowercase the character is=%c",a);

putchar(a);

printf("\n\n\n Enter uppercase character=");

putchar(a-32);

printf("value of character(%c)is=%d",b,b);

getch()

}


-output-

enter one lowercase character=n

lowercase charater is=n

uppercase character is=N

22.//getch character


#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();char a,b;

printf("\n enter one character=");

a=getch();

printf("second the character is=%c",a);

b=getch();

printf("\n\n\n Enter first character=%c\nsecond character==%c",a,b);

getch()

}


-output-

enter first character=D

second character=S

enter first character=D

second character=S


23.//multiply given number using 4 operator


#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();long int number,tempnum;

printf("\n enter an integer=");

Scanf("%ld",&number);

tempnum=number;

number=number<<2;

printf("%ld*4=%ld",tempnum,number);

getch();

}


-output-

enter an integer=450

450*4=1800


24.//program without main() function


#include<stdio.h>

int begin()

{

clrscr();

printf("\n hello Crush tech subcriber=");

}


-output-

hello Crush tech subcriber 


25.//temprature convert from degree centigraded to celsius.

#include<stdio.h>

int main()

{

float celsius,fahrenheit;

printf("enter temp in celsius=");

scanf("%f",&celsius);

fahrenheit=(1.8*celsius)+32;

printf("temperature in Fahrenheit=%f",Fahrenheit);

return 0;

}

-output-

enter temp in celsius=32

temprature in fahrenhiet=89.59998

-----------------------------------------------------------------------------------------------------------------------------

26.//convert total second into hour


#include<stdio.h>

void main()

{

int ts,h,m,s;

printf("enter total sec=");

  scanf("%d",ts);

h=ts/3600;

ts=h%3600;

m=ts/60;

s=ts%60;

printf("hour=%d min=%d ,sec=%d",h,m,s);

}


-output-

enter total sec=3690

hour=1 min=1,sec=30

          

27.//arithmetic operator

#include<stdio.h>

#Include<conio.h>

int main()

{

int a=2,b=3;

int sum,sub,mul,rem,idiv;

float rdiv;

clrscr();

sum=a+b;

sub=a-b;

mul=a*b;

idiv=a/b;

rem=a%b;

rdiv=(float)a/(float)b;

printf("\n sum=%d",sum);

printf("\n sub=%d",sub);

printf("\n mul=%d",mul);

printf("\n idiv=%d",idiv);

printf("\n rem=%d",rem);

printf("\n rdiv=%f",rdiv);

getch();

return 0;

}

Thanks for visit my blog