Computer Science (record)
Computer Science (record)
2pRobRAM TO CONVERT
FA HREN HETI UALUE To CELSIUS 2 4lo/2o2
03.PROh RAm TO CHEck IF A Y6AR
N
Nym B£RS N AN ARRAY AND
FLND THE AyRA6£ AND
AloNG WITH
THSN' NUMBARS
OUTPUT
Enter the principal amount: 5000
Enter the no of years :3
Enter the rate of Interest :2
Simple Interest is :300
Experiment Name / No.: . Camlin Page No.
Dato /4 I02 2022
#include<lostream.h>
#include<conio.h>
void main()
Intp,n,r,si;
10
clrscr();
cout<<"Enter the principal amount:";
cin>>p;
cout<<"Enter the no of years:";
cin>>n;
cout<<"Enter the rate of interest:";
cin>>r;
15
si=p"n*r/100;
cout<<"Simple interest is:"<<si
getch();
20
Teacher's Signature:
OUTPUT
Enter the Fahrenheit value :98
Celsius value :36.666668
Experiment Name / No.: Camlin Page No 02
Dato ]4 I 02 12022
#include<lostream.h>
#include<conio.h>
void main()
10
Int f;
float c;
clrscr();
cout<<"Enter the fahrenheit value:";
cin>>f;
c=(f-32)*5/9;
15
cout<<"celsius value is:"<<c;
getch();
20
Teacher's Signature:
OUTPUT
#include<lostream.h>
#include<conio.h>
void main()
{
Int year;
10
clrscr();
cout<<"\nEnter the year:";
cin>.year;
If(year%4=-0)
{cout<<"\n" <<year<<"is a leap year:";
If(year%100==0)
cout<,"\n is also a special leap year:";
15
Else
cout<<"\n "<<year << "isnot a leap year:";
getch();
20
Teacher's Signature:
OUTPUT
Enter any no :45
The given no is positive
Experiment Name / No.: 04 Camlin Fagc No. O4
Dato /5I o22022
#include<lostream.h>
#include<conio.h>
void main()
10
Int n;
clrscr();
cout<<"Enterany no:";
cin>>n;
if(n>0)
cout<<"The given no is positive:";
else
1
25
Teacher's Signature
OUTPUT
Enter the no :10
Factorial value of 10 is 24320
Experiment Name / No.: O5 Camlin Page No. 0
Date /6 2022
FRom N USIN A
#include<lostream.h>
#include<conio.h>
void main()
1
Intl,n,f=1;
clrscr();
cout<<"Enterthe no:";
cin>>n;
for(i=1;i<=n;i++)
f=f*1;
15
cout<<"Factorial value of"<<n <<"is" <<f;
getch();
}
Teacher's Signaturt
OUTPUT
Enter 10numbers as input
20
40
60
80
100
120
140
160
180
200
Sum of 10 numbers: 1100
Averageof 10numbers: 110
Experiment Name / No.:.
Camlin Pago No. o6
Date |6 o22022
WRITE A PROGRAm To JNpur NUmBLR AND
THeIR Sum AVERAGE.
#include<iostream.h>
#include<conio.h>
void main()
Inti,n,sum=0;
10
Float aVg;
clrscr();
cout<<"Enterthe 10 numbersas input" <<endi;
for (i=1;i<=10;i++)
cin>>n;
Sum=sum+n;
15
Avg=sum/10.0;
cout<<"sum of 10 numbers:" <<sum <<endi;
cout<<" Average of 10 numbers: "<<avg;
getch();
20
24
Teacher's Signature:
OUTPUT
Enter any positive no: 370
The no is an Armstrong no.
Experiment Name / No.: Camlin Pago No. O7
Date ) 02 2022
#include<lostream.h>
#include<conio.h>
void main()
{
10 clrscr()
intn,l,num=0,r;
cout<<"Enter any positive no:";
cin>>n;
i=n;
while(i!-0)
15 n=i%10;
num=num+r*r*r;
I=i/10;
If(num=n)
cout<<" The no is Armstrong no:";
else
20
count<<" The no is not an Armstrong no:":
getch();
Teacher's Signature:
OUTPUT
Enter any string: SANJAY
Reversed string is: YAJNAS
Experiment Name / No.: Camlin Page No. O8
Date /7 I02 2o22
WRTTE To JANpUT A
A STRaN AND
#include<lostream.h>
#include<conio.h>
void main()
10
{
char s[100],temp;
inti=0, j=0;
clrscr();
cout<<" Enter any string:':
cin>>s;
15
ifstrlen(s)-1;
while(i<j)
temp=s[i:
s[i]=s[jl;
s[i]=temp;
i++;
20
Teacher's Signature:
OUTPUT
Enter anycharacter: 8
The given character is a digit
Experiment Name /No.: Camlin Page No. 9
Date 1& | 021 2022
#include<lostream.h>
#include<conio.h>
16
void main()
char ch;
clrscr;
cout<<" Enter any character:";
cin>.ch;
if(ch>='a' &&ch<='z') ||(ch>= 'A' &&ch<= 'z')
15
cout<<" The given character is an alphabet:";
else if(ch>= "0' &&ch<='9)
cout<<" The given character is a digit:";
else
cout<<" The given character is aspecial character:";
getch();
20
TeachersSigne
OUTPUT
Give the no of elements :3
Enter no 1:
30
Enter o2:
50
Enter no 3:
40
Youentered
30
50
40
Average is :40
Experiment Name /No.: Camlin Pago No. |O
Dato /& l02- 12022
#include<lostream.h>
#include<conio.h>
void main()
Int n, *p,sum=0,1,num[100];
10
Float ag;
clrscr
cout<<" Give the no of elements:";
cin>>n;
for(i=0;i<n;i++)
cout<<endl<<" Enter no"<<i+1 <<":" <<endl;
15
cin>.num[i];
P=num
Cout<<endl<<"Youentered";
For(i-0;i<n;i++)
{
Sum=sum+*(p+i);
20
Avg-(float)sum/n;
}
Cout<<endk<" Average is:"; <<avg;
getch();
25
Teacher's Signature: