Escolar Documentos
Profissional Documentos
Cultura Documentos
SUB.BY:-Amit Gupta
Course:-B.Tech
Branch:-Civil (2nd sem)
Roll:-1141097
Program no.-01
OUTPUT:-
Program no.-02
OUTPUT:-
Program no.-03
#include<iostream.h>
#include<conio.h>
Void main()
{
Clrscr ();
Int a, b, c, d;
Cout<<enter 1st number=;
Cin>>a;
Cout<<enter 2nd number=;
Cin>>b;
Cout<<enter 3rd number=;
Cin>>c;
d=a+b+c;
cout<<sum of three numbers are=;
cout<<d;
getch();
}
OUTPUT:-
Program no.-04
Void main()
{
Clrscr ();
Float f, c;
Cout<<enter todays temperature=;
Cin>>c;
f= (1.8*c) +32;
cout<<The temperature in FAHRENHEIT is=;
Cout<<f;
getch ();
}
OUTPUT:-
Program no.-05
#define pi 3.14
Void main()
{
Clrscr();
float r, a, c;
cout<<enter radius of the circle=;
cin>>r;
a=pi*r*r;
c=2*pi*r;
cout<<area of the circle=;
cout<<a;
cout<<\n circumference of the circle=;
cout<<c;
getch ();
}
OUTPUT:-
Program no.-06
#define pi 3.14
Void main()
{
Clrscr ();
Float r, a, v;
Cout<<enter radius of the sphere=;
Cin>>r;
a=4*pi*r*r;
v=4/3*pi*r*r*r;
cout<<area of the sphere=;
Cout<<a;
cout<<\n volume of the sphere=;
cout<<v;
getch ();
}
OUTPUT:-
Program no.-07
{
clrscr ();
float a, b, c, d, s, r;
cout<<Enter 1st number=;
cin>>a;
cout<<Enter 2nd number=;
cin>>b;
cout<<Enter 3rd number=;
cin>>c;
cout<<Enter 4th number=;
cin>>d;
s=a+b+c+d;
r=s/4;
cout<<Average of four number=;
cout<<r;
getch();
}
OUTPUT:-
Programno.-08
#include<iostream.h>
#include<conio.h>
void main()
{
float per;
char grade=*;
clrscr ();
cout <<\n Enter percentage=;
cin>>per;
if(per)=80)
{
grade=A;
}
cout<<\n Result is pass;
cout<<\n Grade is =<<grade;
getch();
}
OUTPUT:-
Programno.-09
#include<conio.h>
void main()
{
int n;
cout<<\n Enter the number=;
cin>>n;
If(n%2==0)
cout<<\n The number is even;
else
cout<<The number is odd;
getch();
}
OUTPUT:-
Programno.-10
#include<iostream.h>
#include<conio.h>
void main()
{
int fcpit,chem,math,total;
float per;
char grade;
clrscr();
cout<<pls Enter the marks of fcpit,chem.,math=;
cin>>fcpit>>chem>>math;
total=fcpit+chem+math;
per=total/3;
if(per)=80)
{
grade=A;
}
else if(per)=60)
{
grade=B;
}
else if(per)=40)
{
grade=C;
}
else
{
grade=F;
}
OUTPUT:-
Programno.-11
{
char choice;
clrscr();
cout<<\n \t MAIN MENU;
cout<<\n R. For Red colour;
cout<<\n W. For White colour;
cout<<\n B. For Blue colour;
cout<<\n Y. For yellow colour;
cout<<\n please enter your choice=;
cin>>choice;
switch(choice)
{
caser:
caseR:
cout<<\n colour is Red;
break;
casew:
caseW:
cout<<\n colour is white;
break;
caseb:
caseB:
cout<<\n colour is blue;
break;
casey:
caseY:
cout<<\n colour is yellow;
break;
default:
cout<<\n colour does not found;
}
getch();
}
OUTPUT:-
Programno.-12
OUTPUT:-
Programno.-13
cin>>n;
sum=0;
i=1;
while(i<=n)
{
sum=sum+1;
i=i+1;
}
av=(float)sum/n;
cout<<\n sum is=<<sum;
cout<<\n average is=<<av;
getche();
}
Program no.-14
disp();
cout<<"Even";
}
else
{
disp();
cout<<"odd";
}
getch();
}
void disp()
{
cout<<"The Entered no. is =";
}
OUTPUT:-
Program:-15
OUTPUT:-
Program No:-16
OUTPUT:-
Program No.:-17
OUTPUT:-
Program no.:-18
OUTPUT:-
Program no:-19
for(j=1;j<=m;j++)
{
cout<<a[i][j];
}
cout<<"\n";
}
getch();
}
OUTPUT:-