SlideShare a Scribd company logo
The Programs
S. No. To Find Given
1. nth term
When
first term, common
difference,value of n
Is Given
2. Sum of n terms
3. Arithematic
Mean
enter first term,
common
difference,value of n
4. n if nth term is
given
enter first term,
common difference,
Enter nth term
5. n if sum of n
term is given
enter first term,
common difference,
sum of n terms
 Code#include<iostream.h>
#include<conio.h>
#include<math.h>
int main()
{
clrscr();
int ch;
float a,nth,n,d,s,AM,i,j;
cout<<"n";
cout <<"Choice Menu"<<"n";
cout<<"n";
cout<<"1. nth term"<<"n";
cout<<"2. Sum of n terms"<<"n";
cout<<"3. Arithematic Mean"<<"n";
cout<<"4. n if nth term is given"<<"n";
cout<<"5. n if sum of n term is given"<<"n";
cin>>ch;
switch(ch)
{
case 1 : cout<<"enter first term, common difference,value of n";
cin>>a>>d>>n;
nth = a + (n-1)*d;
cout<<"the nth term is"<<nth<<"n";
break;
case 2 : cout<<"enter first term, common difference,value of
n";
cin>>a>>d>>n;
s = n/2*((a+a) +(n -1))*d;
cout<<"the sum is "<<s;
break;
case 3 : cout<<"enter first term, common diff.,value of n";
cin>>a>>d>>n;
nth = a + (n-1)*d;
AM = (a + nth)/2;
cout<<"the AM is"<<nth<<"n";
break;
case 4 : cout<<"enter first term, common difference, Enter nth
term";
cin>>a>>d>>nth;
n = (nth - a + d)/d;
cout<<"the value of n is " <<n;
break;
case 5 : float b,c,e,f,g,h,i,m;
cout<<"enter first term, common difference, Enter sum of n
term";
cin>>a>>d>>s;
h= (d -(2*a));
b =(-((2*a)- d));
c = pow(h,2.0);
e = (8*d*s);
g =(c+e);
f =sqrt(g);
n =(b + f)/2*d ;
i =(b - f)/2*d ;
if (i < 0)
cout<<"the value of n is " <<n;
else
cout<<"the value of n is " <<n<<"or"<<m;
break;
}
getch ();
return 0;
The resultant value when a number is given with
the power to which it has to be raised for any
given number
For Eg :- 5 raise to 3 is 125
Code
#include<iostream.h>
#include<conio.h>
#include<math.h>
int main()
{
clrscr();
float number, power, answer;
cout<<"enter the number :- ";
cin>>number;
cout<<"enter the power of the number :- ";
cin>>power;
answer = pow (number,power);
cout<< number<<" raised to "<< power<<" is "<< answer;
getch();
return 0;
}
A quiz in C++
€ Code
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int IQ, ch1,ch2, ch3, ch4;
int pnt = 0;
cout<<"Qs.1)In how many ways cane we rename a file
"<<"n";
cout<<"1.1 way "<<"n";
cout<<"2.3 ways "<<"n";
cout<<"3.5 ways "<<"n";
cout<<"4.Can't say ";
cin>>ch1;
if (ch1==2)
{
pnt =(pnt + 3);
cout<<"correct Answer.............";
}
else
cout<<"wrong Answer...............";
cout<<"n";
cout<<"Qs. 2) fullstop is a valid character for filename in
Win Xp. What about its validity in Win 7 "<<"n";
cout<<"1.Valid "<<"n";
cout<<"2.Unvalid "<<"n";
cin>>ch2;
if (ch2==2)
{
pnt =(pnt + 3);
cout<<"correct Answer..............";
}
else
cout<<"wrong Answer................";
cout <<pnt;
cout<<"n";
cout<<"Qs.3)The inventing country of supercomputer PACE
is "<<"n";
cout<<"1.India "<<"n";
cout<<"2.China "<<"n";
cout<<"3.Japan "<<"n";
cin>>ch3;
if (ch3==1)
{
pnt =(pnt + 3);
cout<<"correct Answer.............";
}
else
cout<<"wrong Answer...............";
cout<<"n";
cout<<"Qs.4)Uninitialized variable will give as outputcout<<"Qs.4)Uninitialized variable will give as output
"<<"n";"<<"n";
cout<<"1.Garbage Value "<<"n";cout<<"1.Garbage Value "<<"n";
cout<<"2.zero "<<"n";cout<<"2.zero "<<"n";
cout<<"3.No output "<<"n";cout<<"3.No output "<<"n";
cin>>ch4;cin>>ch4;
if (ch4==1)if (ch4==1)
{{
pnt =(pnt + 3);pnt =(pnt + 3);
cout<<"correct Answer.............";cout<<"correct Answer.............";
}}
elseelse
cout<<"wrong Answer...............";cout<<"wrong Answer...............";
cout<<"n";cout<<"n";
IQ = pnt/3;IQ = pnt/3;
cout<<"please Wait"<<"n";cout<<"please Wait"<<"n";
cout<<"Generating Result"<<"n";cout<<"Generating Result"<<"n";
cout<< "you Answered "<<IQ<<" question correctly";cout<< "you Answered "<<IQ<<" question correctly";
cout<<" your score is:- "<< pnt;cout<<" your score is:- "<< pnt;
getch();getch();
return 0;return 0;
}}
€ Code continued
To determine whether the area of the given
rectangle is greater then it’s perimeter or not
 Code
#include<iostream.h>#include<iostream.h>
#include<conio.h>#include<conio.h>
int main ()int main ()
{{
clrscr();clrscr();
float l,b, p, a;float l,b, p, a;
cout<<"enter length, bredth of the rectangle";cout<<"enter length, bredth of the rectangle";
cin>>l>>b;cin>>l>>b;
p = 2* (l +b);p = 2* (l +b);
a = l*b;a = l*b;
if (a >p)if (a >p)
cout <<"the area is greater then the permeter"<<"n";cout <<"the area is greater then the permeter"<<"n";
elseelse
cout<<"the area is smaller then the perimeter"<<"n";cout<<"the area is smaller then the perimeter"<<"n";
cout<<"perimeter :-"<<p<<"n";cout<<"perimeter :-"<<p<<"n";
cout<<"area :-"<<a;cout<<"area :-"<<a;
getch();getch();
return 0;return 0;
}}
To determine the compound interest on
given amount for a given period and rate
Code
#include <iostream.h>#include <iostream.h>
#include<conio.h>#include<conio.h>
#include<math.h>#include<math.h>
int main()int main()
{{
clrscr();clrscr();
float P,R,N,A,H,B;float P,R,N,A,H,B;
cout<<"Enter Principle Amount: ";cout<<"Enter Principle Amount: ";
cin>> P;cin>> P;
cout<<"Enter Rate of Interest: ";cout<<"Enter Rate of Interest: ";
cin>> R;cin>> R;
cout<<"Enter Time Period (in years): ";cout<<"Enter Time Period (in years): ";
cin>>N;cin>>N;
H = (1 + R/100);H = (1 + R/100);
B = pow (H,N);B = pow (H,N);
A = (P*B);A = (P*B);
cout<<"Principle Amout Rs."<<P<<"n";cout<<"Principle Amout Rs."<<P<<"n";
cout<<"Rate of Interest "<<R<<" %"<<"n";cout<<"Rate of Interest "<<R<<" %"<<"n";
cout<<"Time Period "<<N<<" years"<<"n";cout<<"Time Period "<<N<<" years"<<"n";
cout<<"the compoud interest for the given amount is Rs."<<A;cout<<"the compoud interest for the given amount is Rs."<<A;
getch();getch();
return 0;return 0;
}}
To determine the Quotient and RemainderTo determine the Quotient and Remainder
when a given number is divided by anotherwhen a given number is divided by another
given numbergiven number
σ CodeCode
#include <iostream.h>#include <iostream.h>
#include<conio.h>#include<conio.h>
int main ()int main ()
{{
clrscr();clrscr();
int a,div,b,num;int a,div,b,num;
cout<<"enter the number to be divided";cout<<"enter the number to be divided";
cin>>num;cin>>num;
cout<<"enter the number by which "<<num<<" has to be divided";cout<<"enter the number by which "<<num<<" has to be divided";
cin>>div;cin>>div;
a = num/div;a = num/div;
b = num%div;b = num%div;
cout<<num<<" divided by "<<div<<" gives "<<"n";cout<<num<<" divided by "<<div<<" gives "<<"n";
cout <<"quotient as "<<a<<"n";cout <<"quotient as "<<a<<"n";
cout <<"remainder as "<<b;cout <<"remainder as "<<b;
getch();getch();
return 0;return 0;
}}
To determine the result when a givenTo determine the result when a given
number is raised to all numbers from 1 tonumber is raised to all numbers from 1 to
the given valuethe given value
∏ Code
#include<iostream.h>#include<iostream.h>
#include<conio.h>#include<conio.h>
#include<math.h>#include<math.h>
#include<process.h>#include<process.h>
int main ()int main ()
{{
clrscr();clrscr();
int num, por;int num, por;
cout<<"Enter the number whose powers are to be listed";cout<<"Enter the number whose powers are to be listed";
cin>>num;cin>>num;
cout<<"enter the power till you want the powers to be listed";cout<<"enter the power till you want the powers to be listed";
cin>>por;cin>>por;
for ( int i = 1;i <= por; i++)for ( int i = 1;i <= por; i++)
cout << pow(num,i)<<"n";cout << pow(num,i)<<"n";
getch ();getch ();
return 0;return 0;
}}
To Know the money present in a
customer’s account at the end of specific
time. Given amount deposited and time
period
 Code
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<process.h>
int main ()
{
clrscr();
float amt, rt, A, H, B;
int yrs,ch;
cout<<"enter amount deposited";
cin>>amt;
cout<<"number of years";
cin>>yrs;
cout<<"n";
cout<<"choose most appropriate option about your amonut and time
period"<<"n";
cout<<"1. amout less than 2000, yrs more than 1"<<"n";
cout<<"2. amout between 2000 and 6000,yrs more than or equal to 1 "<<"n";
cout<<"3. amout more than 6000, yrs more than or equal to 1"<<"n";
cout<<"4. yrs more than or equal to 5"<<"n";
cout<<"5. none of the above ";
cin>>ch;
switch(ch)
{
case 1:rt =5;
break;
case 2:rt =7;
break;
case 3:rt =8;
break;
case 4:rt =10;
break;
case 5:rt = 3;
break;
}
H = (1 + rt/100);
B = pow( H, yrs);
A = (amt * B);
cout <<" the C. I for the "<<A;
getch();
return 0;
}
To find the entered amount’s value in another
country’s currency
Serial no.Serial no. Amount entered inAmount entered in Resulting amount inResulting amount in
11 INRINR US $US $
22 US $US $ INRINR
33 INRINR EuroEuro
44 EuroEuro INRINR
55 INRINR YenYen
66 YenYen INRINR
δ Code
#include<iostream.h>
#include<conio.h>
#include<process.h>
int main()
{
clrscr();
int ch;
float inri, inra, usdi, usda,inrie, inrae,euri,
eura,inriy,inray,yeni,yena;
cout<<"Choose from and to (currency)"<<"n";
cout<<"1.INR to US $"<<"n";
cout<<"2.US $ to INR"<<"n";
cout<<"3.INR to Euro"<<"n";
cout<<"4.Euro to INR"<<"n";
cout<<"5.INR to Yen "<<"n";
cout<<"6.Yen to INR "<<"n";
cin>>ch;
switch(ch)
{
case 1:cout<<"Enter amount in INR(Indian National
Rupee) :-";
cin>>inri;
inra = (inri/53);
cout<<inri<<" rupees are equal to "<<inra<<" US $"<<"n";
break;
case 2:cout<<"Enter amount in US $ (US dollars) :-";
cin>>usdi;
usda = (usdi * 53);
cout<<usdi<<" US $ are equal to "<<usda<<"Indian rupees
"<<"n";
break;
case 3:cout<<"Enter amount in INR(Indian National Rupee) :-";
cin>>inrie;
inrae = (inrie/70);
cout<<inrie<<" rupees are equal to "<<inra<<" Euro's"<<"n";
break;
case 4:cout<<"Enter amount in Euro's :-";
cin>>euri;
eura = (euri * 70);
cout<<euri<<" Euor's are equal to "<<eura<<"Indian rupees
"<<"n";
break;
case 5:cout<<"Enter amount in INR(Indian National Rupee) :-";
cin>>inriy;
inray = (inriy*1.4);
cout<<inriy<<" rupees are equal to "<<inra<<" Yen"<<"n";
break;
case 6:cout<<"Enter amount in Yen's :-";
cin>>yeni;
yena = (yeni/1.4);
cout<<inri<<" Yen are equal to "<<inra<<" Indian rupees"<<"n";
break;
}
getch();
return 0;
}
To know the amount of solar energy received
in the given area over a given period of time
Code
#include<iostream.h>
#include<conio.h>
int main ()
{
clrscr();
int t;
float ar,s;
float S = 1.4;
cout<<"enter area(mt. sq.), time (sec)";
cin>>ar>>t;
s = ar*t*60*1.4;
cout<<"solar energy recieved ="<<s<<"kJ";
getch();
return 0;
}
THANKTHANK
YOUYOU

More Related Content

Viewers also liked

Object Oriented Program
Object Oriented ProgramObject Oriented Program
Object Oriented ProgramAlisha Jain
 
C++ arrays part2
C++ arrays part2C++ arrays part2
C++ arrays part2
Subhasis Nayak
 
C++11
C++11C++11
Flow control in c++
Flow control in c++Flow control in c++
Flow control in c++
Subhasis Nayak
 
C++ revision tour
C++ revision tourC++ revision tour
C++ revision tour
Swarup Kumar Boro
 
Flow of Control
Flow of ControlFlow of Control
Flow of Control
Praveen M Jigajinni
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
Abdullah Turkistani
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Stacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arora
kulachihansraj
 
Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++
Deepak Singh
 
C++ classes
C++ classesC++ classes
C++ classes
imhammadali
 
C++ Function
C++ FunctionC++ Function
C++ FunctionHajar
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
03062679929
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
Awais Alam
 
functions of C++
functions of C++functions of C++
functions of C++
tarandeep_kaur
 
Array in c language
Array in c languageArray in c language
Array in c languagehome
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
KurdGul
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
k v
 

Viewers also liked (20)

Object Oriented Program
Object Oriented ProgramObject Oriented Program
Object Oriented Program
 
C++ arrays part2
C++ arrays part2C++ arrays part2
C++ arrays part2
 
C++11
C++11C++11
C++11
 
Flow control in c++
Flow control in c++Flow control in c++
Flow control in c++
 
C++ revision tour
C++ revision tourC++ revision tour
C++ revision tour
 
Flow of Control
Flow of ControlFlow of Control
Flow of Control
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Stacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arora
 
Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++
 
Flow of control ppt
Flow of control pptFlow of control ppt
Flow of control ppt
 
C++ classes
C++ classesC++ classes
C++ classes
 
C++ Function
C++ FunctionC++ Function
C++ Function
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 
functions of C++
functions of C++functions of C++
functions of C++
 
Data types
Data typesData types
Data types
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 

Similar to C++ programming

Project in programming
Project in programmingProject in programming
Project in programming
sahashi11342091
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
kinan keshkeh
 
Hospital management
Hospital managementHospital management
Hospital management
Naman Maheshwari
 
Hospital management
Hospital managementHospital management
Hospital management
Naman Maheshwari
 
Statement
StatementStatement
Statement
Ahmad Kamal
 
Programación de C++, Función Case
Programación de C++, Función CaseProgramación de C++, Función Case
Programación de C++, Función Case
Ramon Lop-Mi
 
Programa Sumar y Multiplicar
Programa Sumar y MultiplicarPrograma Sumar y Multiplicar
Programa Sumar y Multiplicar
Anais Rodriguez
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
leovasquez17
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
leovasquez17
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6
phoe3
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
Farhan Ab Rahman
 
Programming - Marla Fuentes
Programming - Marla FuentesProgramming - Marla Fuentes
Programming - Marla Fuentesmfuentessss
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
Syed Umair
 
FP 201 Unit 3
FP 201 Unit 3 FP 201 Unit 3
FP 201 Unit 3 rohassanie
 
10 template code program
10 template code program10 template code program
10 template code program
Bint EL-maghrabi
 
C++ file
C++ fileC++ file

Similar to C++ programming (20)

Project in programming
Project in programmingProject in programming
Project in programming
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
project
projectproject
project
 
Hospital management
Hospital managementHospital management
Hospital management
 
Hospital management
Hospital managementHospital management
Hospital management
 
Statement
StatementStatement
Statement
 
Oop1
Oop1Oop1
Oop1
 
Programación de C++, Función Case
Programación de C++, Función CaseProgramación de C++, Función Case
Programación de C++, Función Case
 
Programa Sumar y Multiplicar
Programa Sumar y MultiplicarPrograma Sumar y Multiplicar
Programa Sumar y Multiplicar
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
 
Programming - Marla Fuentes
Programming - Marla FuentesProgramming - Marla Fuentes
Programming - Marla Fuentes
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
FP 201 Unit 3
FP 201 Unit 3 FP 201 Unit 3
FP 201 Unit 3
 
10 template code program
10 template code program10 template code program
10 template code program
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 

More from Pranav Ghildiyal

Lasers
LasersLasers
Global warming :- A PowerPoint Presentation
Global warming :- A PowerPoint PresentationGlobal warming :- A PowerPoint Presentation
Global warming :- A PowerPoint Presentation
Pranav Ghildiyal
 
A Report On Disaster Management
A Report On Disaster ManagementA Report On Disaster Management
A Report On Disaster Management
Pranav Ghildiyal
 
Recycle and reuse of everyday material
Recycle and reuse of everyday materialRecycle and reuse of everyday material
Recycle and reuse of everyday material
Pranav Ghildiyal
 
Word of the day (may)
Word of  the day (may)Word of  the day (may)
Word of the day (may)
Pranav Ghildiyal
 
Boost your knowledge
Boost your knowledgeBoost your knowledge
Boost your knowledge
Pranav Ghildiyal
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
Pranav Ghildiyal
 
CBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detectorCBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detector
Pranav Ghildiyal
 
CBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threadsCBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threadsPranav Ghildiyal
 
CBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europeCBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europe
Pranav Ghildiyal
 
H1 n1 swine flu
H1 n1 swine fluH1 n1 swine flu
H1 n1 swine flu
Pranav Ghildiyal
 
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challengeCBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
Pranav Ghildiyal
 
CBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics SoundCBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics Sound
Pranav Ghildiyal
 
CBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resourcesCBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resources
Pranav Ghildiyal
 
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pureCBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
Pranav Ghildiyal
 
CBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equationsCBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equations
Pranav Ghildiyal
 
CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)
Pranav Ghildiyal
 
CBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progressionCBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progression
Pranav Ghildiyal
 
CBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalitiesCBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalities
Pranav Ghildiyal
 

More from Pranav Ghildiyal (20)

Lasers
LasersLasers
Lasers
 
Global warming :- A PowerPoint Presentation
Global warming :- A PowerPoint PresentationGlobal warming :- A PowerPoint Presentation
Global warming :- A PowerPoint Presentation
 
A Report On Disaster Management
A Report On Disaster ManagementA Report On Disaster Management
A Report On Disaster Management
 
Recycle and reuse of everyday material
Recycle and reuse of everyday materialRecycle and reuse of everyday material
Recycle and reuse of everyday material
 
Word of the day (may)
Word of  the day (may)Word of  the day (may)
Word of the day (may)
 
Boost your knowledge
Boost your knowledgeBoost your knowledge
Boost your knowledge
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
CBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detectorCBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detector
 
CBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threadsCBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threads
 
Shopping mall
Shopping mallShopping mall
Shopping mall
 
CBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europeCBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europe
 
H1 n1 swine flu
H1 n1 swine fluH1 n1 swine flu
H1 n1 swine flu
 
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challengeCBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
 
CBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics SoundCBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics Sound
 
CBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resourcesCBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resources
 
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pureCBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
 
CBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equationsCBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equations
 
CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)
 
CBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progressionCBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progression
 
CBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalitiesCBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalities
 

Recently uploaded

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

C++ programming

  • 1.
  • 3. S. No. To Find Given 1. nth term When first term, common difference,value of n Is Given 2. Sum of n terms 3. Arithematic Mean enter first term, common difference,value of n 4. n if nth term is given enter first term, common difference, Enter nth term 5. n if sum of n term is given enter first term, common difference, sum of n terms
  • 4.  Code#include<iostream.h> #include<conio.h> #include<math.h> int main() { clrscr(); int ch; float a,nth,n,d,s,AM,i,j; cout<<"n"; cout <<"Choice Menu"<<"n"; cout<<"n"; cout<<"1. nth term"<<"n"; cout<<"2. Sum of n terms"<<"n"; cout<<"3. Arithematic Mean"<<"n"; cout<<"4. n if nth term is given"<<"n"; cout<<"5. n if sum of n term is given"<<"n"; cin>>ch; switch(ch) { case 1 : cout<<"enter first term, common difference,value of n"; cin>>a>>d>>n; nth = a + (n-1)*d; cout<<"the nth term is"<<nth<<"n"; break; case 2 : cout<<"enter first term, common difference,value of n"; cin>>a>>d>>n; s = n/2*((a+a) +(n -1))*d; cout<<"the sum is "<<s; break; case 3 : cout<<"enter first term, common diff.,value of n"; cin>>a>>d>>n; nth = a + (n-1)*d; AM = (a + nth)/2; cout<<"the AM is"<<nth<<"n"; break; case 4 : cout<<"enter first term, common difference, Enter nth term"; cin>>a>>d>>nth; n = (nth - a + d)/d; cout<<"the value of n is " <<n; break; case 5 : float b,c,e,f,g,h,i,m; cout<<"enter first term, common difference, Enter sum of n term"; cin>>a>>d>>s; h= (d -(2*a)); b =(-((2*a)- d)); c = pow(h,2.0); e = (8*d*s); g =(c+e); f =sqrt(g); n =(b + f)/2*d ; i =(b - f)/2*d ; if (i < 0) cout<<"the value of n is " <<n; else cout<<"the value of n is " <<n<<"or"<<m; break; } getch (); return 0;
  • 5. The resultant value when a number is given with the power to which it has to be raised for any given number For Eg :- 5 raise to 3 is 125
  • 6. Code #include<iostream.h> #include<conio.h> #include<math.h> int main() { clrscr(); float number, power, answer; cout<<"enter the number :- "; cin>>number; cout<<"enter the power of the number :- "; cin>>power; answer = pow (number,power); cout<< number<<" raised to "<< power<<" is "<< answer; getch(); return 0; }
  • 7. A quiz in C++
  • 8. € Code #include<iostream.h> #include<conio.h> int main() { clrscr(); int IQ, ch1,ch2, ch3, ch4; int pnt = 0; cout<<"Qs.1)In how many ways cane we rename a file "<<"n"; cout<<"1.1 way "<<"n"; cout<<"2.3 ways "<<"n"; cout<<"3.5 ways "<<"n"; cout<<"4.Can't say "; cin>>ch1; if (ch1==2) { pnt =(pnt + 3); cout<<"correct Answer............."; } else cout<<"wrong Answer..............."; cout<<"n"; cout<<"Qs. 2) fullstop is a valid character for filename in Win Xp. What about its validity in Win 7 "<<"n"; cout<<"1.Valid "<<"n"; cout<<"2.Unvalid "<<"n"; cin>>ch2; if (ch2==2) { pnt =(pnt + 3); cout<<"correct Answer.............."; } else cout<<"wrong Answer................"; cout <<pnt; cout<<"n"; cout<<"Qs.3)The inventing country of supercomputer PACE is "<<"n"; cout<<"1.India "<<"n"; cout<<"2.China "<<"n"; cout<<"3.Japan "<<"n"; cin>>ch3; if (ch3==1) { pnt =(pnt + 3); cout<<"correct Answer............."; } else cout<<"wrong Answer..............."; cout<<"n";
  • 9. cout<<"Qs.4)Uninitialized variable will give as outputcout<<"Qs.4)Uninitialized variable will give as output "<<"n";"<<"n"; cout<<"1.Garbage Value "<<"n";cout<<"1.Garbage Value "<<"n"; cout<<"2.zero "<<"n";cout<<"2.zero "<<"n"; cout<<"3.No output "<<"n";cout<<"3.No output "<<"n"; cin>>ch4;cin>>ch4; if (ch4==1)if (ch4==1) {{ pnt =(pnt + 3);pnt =(pnt + 3); cout<<"correct Answer.............";cout<<"correct Answer............."; }} elseelse cout<<"wrong Answer...............";cout<<"wrong Answer..............."; cout<<"n";cout<<"n"; IQ = pnt/3;IQ = pnt/3; cout<<"please Wait"<<"n";cout<<"please Wait"<<"n"; cout<<"Generating Result"<<"n";cout<<"Generating Result"<<"n"; cout<< "you Answered "<<IQ<<" question correctly";cout<< "you Answered "<<IQ<<" question correctly"; cout<<" your score is:- "<< pnt;cout<<" your score is:- "<< pnt; getch();getch(); return 0;return 0; }} € Code continued
  • 10. To determine whether the area of the given rectangle is greater then it’s perimeter or not
  • 11.  Code #include<iostream.h>#include<iostream.h> #include<conio.h>#include<conio.h> int main ()int main () {{ clrscr();clrscr(); float l,b, p, a;float l,b, p, a; cout<<"enter length, bredth of the rectangle";cout<<"enter length, bredth of the rectangle"; cin>>l>>b;cin>>l>>b; p = 2* (l +b);p = 2* (l +b); a = l*b;a = l*b; if (a >p)if (a >p) cout <<"the area is greater then the permeter"<<"n";cout <<"the area is greater then the permeter"<<"n"; elseelse cout<<"the area is smaller then the perimeter"<<"n";cout<<"the area is smaller then the perimeter"<<"n"; cout<<"perimeter :-"<<p<<"n";cout<<"perimeter :-"<<p<<"n"; cout<<"area :-"<<a;cout<<"area :-"<<a; getch();getch(); return 0;return 0; }}
  • 12. To determine the compound interest on given amount for a given period and rate
  • 13. Code #include <iostream.h>#include <iostream.h> #include<conio.h>#include<conio.h> #include<math.h>#include<math.h> int main()int main() {{ clrscr();clrscr(); float P,R,N,A,H,B;float P,R,N,A,H,B; cout<<"Enter Principle Amount: ";cout<<"Enter Principle Amount: "; cin>> P;cin>> P; cout<<"Enter Rate of Interest: ";cout<<"Enter Rate of Interest: "; cin>> R;cin>> R; cout<<"Enter Time Period (in years): ";cout<<"Enter Time Period (in years): "; cin>>N;cin>>N; H = (1 + R/100);H = (1 + R/100); B = pow (H,N);B = pow (H,N); A = (P*B);A = (P*B); cout<<"Principle Amout Rs."<<P<<"n";cout<<"Principle Amout Rs."<<P<<"n"; cout<<"Rate of Interest "<<R<<" %"<<"n";cout<<"Rate of Interest "<<R<<" %"<<"n"; cout<<"Time Period "<<N<<" years"<<"n";cout<<"Time Period "<<N<<" years"<<"n"; cout<<"the compoud interest for the given amount is Rs."<<A;cout<<"the compoud interest for the given amount is Rs."<<A; getch();getch(); return 0;return 0; }}
  • 14. To determine the Quotient and RemainderTo determine the Quotient and Remainder when a given number is divided by anotherwhen a given number is divided by another given numbergiven number
  • 15. σ CodeCode #include <iostream.h>#include <iostream.h> #include<conio.h>#include<conio.h> int main ()int main () {{ clrscr();clrscr(); int a,div,b,num;int a,div,b,num; cout<<"enter the number to be divided";cout<<"enter the number to be divided"; cin>>num;cin>>num; cout<<"enter the number by which "<<num<<" has to be divided";cout<<"enter the number by which "<<num<<" has to be divided"; cin>>div;cin>>div; a = num/div;a = num/div; b = num%div;b = num%div; cout<<num<<" divided by "<<div<<" gives "<<"n";cout<<num<<" divided by "<<div<<" gives "<<"n"; cout <<"quotient as "<<a<<"n";cout <<"quotient as "<<a<<"n"; cout <<"remainder as "<<b;cout <<"remainder as "<<b; getch();getch(); return 0;return 0; }}
  • 16. To determine the result when a givenTo determine the result when a given number is raised to all numbers from 1 tonumber is raised to all numbers from 1 to the given valuethe given value
  • 17. ∏ Code #include<iostream.h>#include<iostream.h> #include<conio.h>#include<conio.h> #include<math.h>#include<math.h> #include<process.h>#include<process.h> int main ()int main () {{ clrscr();clrscr(); int num, por;int num, por; cout<<"Enter the number whose powers are to be listed";cout<<"Enter the number whose powers are to be listed"; cin>>num;cin>>num; cout<<"enter the power till you want the powers to be listed";cout<<"enter the power till you want the powers to be listed"; cin>>por;cin>>por; for ( int i = 1;i <= por; i++)for ( int i = 1;i <= por; i++) cout << pow(num,i)<<"n";cout << pow(num,i)<<"n"; getch ();getch (); return 0;return 0; }}
  • 18. To Know the money present in a customer’s account at the end of specific time. Given amount deposited and time period
  • 19.  Code #include<iostream.h> #include<conio.h> #include<math.h> #include<process.h> int main () { clrscr(); float amt, rt, A, H, B; int yrs,ch; cout<<"enter amount deposited"; cin>>amt; cout<<"number of years"; cin>>yrs; cout<<"n"; cout<<"choose most appropriate option about your amonut and time period"<<"n"; cout<<"1. amout less than 2000, yrs more than 1"<<"n"; cout<<"2. amout between 2000 and 6000,yrs more than or equal to 1 "<<"n"; cout<<"3. amout more than 6000, yrs more than or equal to 1"<<"n"; cout<<"4. yrs more than or equal to 5"<<"n"; cout<<"5. none of the above "; cin>>ch; switch(ch) { case 1:rt =5; break; case 2:rt =7; break; case 3:rt =8; break; case 4:rt =10; break; case 5:rt = 3; break; } H = (1 + rt/100); B = pow( H, yrs); A = (amt * B); cout <<" the C. I for the "<<A; getch(); return 0; }
  • 20. To find the entered amount’s value in another country’s currency Serial no.Serial no. Amount entered inAmount entered in Resulting amount inResulting amount in 11 INRINR US $US $ 22 US $US $ INRINR 33 INRINR EuroEuro 44 EuroEuro INRINR 55 INRINR YenYen 66 YenYen INRINR
  • 21. δ Code #include<iostream.h> #include<conio.h> #include<process.h> int main() { clrscr(); int ch; float inri, inra, usdi, usda,inrie, inrae,euri, eura,inriy,inray,yeni,yena; cout<<"Choose from and to (currency)"<<"n"; cout<<"1.INR to US $"<<"n"; cout<<"2.US $ to INR"<<"n"; cout<<"3.INR to Euro"<<"n"; cout<<"4.Euro to INR"<<"n"; cout<<"5.INR to Yen "<<"n"; cout<<"6.Yen to INR "<<"n"; cin>>ch; switch(ch) { case 1:cout<<"Enter amount in INR(Indian National Rupee) :-"; cin>>inri; inra = (inri/53); cout<<inri<<" rupees are equal to "<<inra<<" US $"<<"n"; break; case 2:cout<<"Enter amount in US $ (US dollars) :-"; cin>>usdi; usda = (usdi * 53); cout<<usdi<<" US $ are equal to "<<usda<<"Indian rupees "<<"n"; break; case 3:cout<<"Enter amount in INR(Indian National Rupee) :-"; cin>>inrie; inrae = (inrie/70); cout<<inrie<<" rupees are equal to "<<inra<<" Euro's"<<"n"; break; case 4:cout<<"Enter amount in Euro's :-"; cin>>euri; eura = (euri * 70); cout<<euri<<" Euor's are equal to "<<eura<<"Indian rupees "<<"n"; break; case 5:cout<<"Enter amount in INR(Indian National Rupee) :-"; cin>>inriy; inray = (inriy*1.4); cout<<inriy<<" rupees are equal to "<<inra<<" Yen"<<"n"; break; case 6:cout<<"Enter amount in Yen's :-"; cin>>yeni; yena = (yeni/1.4); cout<<inri<<" Yen are equal to "<<inra<<" Indian rupees"<<"n"; break; } getch(); return 0; }
  • 22. To know the amount of solar energy received in the given area over a given period of time
  • 23. Code #include<iostream.h> #include<conio.h> int main () { clrscr(); int t; float ar,s; float S = 1.4; cout<<"enter area(mt. sq.), time (sec)"; cin>>ar>>t; s = ar*t*60*1.4; cout<<"solar energy recieved ="<<s<<"kJ"; getch(); return 0; }