C Programming Language Basic Programming Examples, C Programming Basics, C Programming Basics Program, C Programming Examples With Output.
C Programming Examples With Output |
1) Wright A Program Print Addition Of Two Constant Numbers.
/* Addition Of Two Constant Numbers */
#include<stdio.h>
int main ()
{
int
a, b,
c;
a=20;
b=15;
c=a+b;
printf("Addition
= %d", c);
return
0;
}
Output :- Addition = 35
2) Wright A Program Print Multiplication Of Two Constant Numbers.
/* Multiplication Of 2 Constant Numbers */
#include<stdio.h>
int main ()
{
int
a, b,
c;
a=20;
b=15;
c=a*b;
printf("Multiplication = %d",
c);
return
0;
}
Output :- Multiplication =300
3) Wright A Program Print Addition, Subtraction, Multipliction And Division Of Two Constant Numbers.
/* Addition Subtraction Multipliction Division Of Two Constant Numbers */
#include<stdio.h>
int main ()
{
int
x, y,
a, s, m, d;
x
= 60;
y=
35;
a=x+y;
printf("Addition
=%d", a);
s=x-y;
printf("\nSubtraction
= %d", s);
m=x*y;
printf("\nMultipliction
=%d", m);
d=x/y;
printf("\nDivision
=%d", d);
return
0;
}
Output :- Addition = 95
Subtraction = 25
Multipliction = 2100
Division = 1
4) Wright A Program Declare Value Variable R Print Area Of Circle.
/*Area Of Circle */
#include<stdio.h>
int main ()
{
float
r, pi,
a;
r=8.5;
pi=3.14;
a=pi*r*r;
printf("Area
Of Cirle = %f", a);
return
0;
}
Output :- Area Of Cirle = 226.865005
5) Wright A Program Declare Value Variable length And height Print Area Of Rectangal.
/*Area Of Rectangal */
#include<stdio.h>
int main ()
{
float
length, height ,
a;
length
= 6.8;
height
=10.5;
a=length*height;
printf("Are
of rectangale = %f", a);
return
0;
Comments
Post a Comment