SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
Install Borland C++ 5.02 to your computer
First how to open the DOS(standard) to write a C++ program
File New Project… ok Target Name: Your name Platform DOS(Standard)ok
Double click on Your name or (proj0023.cpp[.cpp])
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
#include <iostream.h>
#include <conio.h>
int x,y;
main()
{
cout<<"X=";
cin>>x;
cout<<"Y=";
cin>>y;
if(x>y)
cout<<"X is Largest="<<x;
else
cout<<"Y is Largest="<<y;
getch();
}
X=4
Y=7
Y is Largest=7
#include <iostream.h>
#include <conio.h>
int a,b,c;
main()
{
cout<<"Please insert two numbers:n";
cin>>a>>b;
cout<<"a="<<a<<" b="<<b;
c=b;
b=a;
a=c;
cout<<"nYour Swap is:n";
cout<<"a="<<a<<" b="<<b;
getch();
}
Please insert two numbers:
3 4
a=3 b=4
Your Swap is:
a=4 b=3
Q1/Write a C++ programming to read two values then print out the largest?
Q2/Write a C++ program to swap the values of two variables say a,b?
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
#include <iostream.h>
#include <conio.h>
#include <math.h>
int x,y,e;
main()
{
cout<<"X=";
cin>>x;
if(x>0)
{
cout<<"E=";
cin>>e;
y=pow(e,x)+5;
cout<<"Y="<<y;
}
else
{
y=x+7;
cout<<"Y="<<y;
}
getch();
}
X=3
E=4
Y=69
X= -4
Y=3
Q3/Write C++ program to evaluate y depending on x value as in the following condition:
If x>0 then y=ex
+5;
If x<0 then y=x+7
Or
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
N=3
X=4
X=5
X=6
Sum=15
#include <iostream.h>
#include <conio.h>
int l,w,area;
main()
{
cout<<”L=”;
cin>>l;
cout<<”W=”;
cin>>w;
area=l*w;
cout<<"Area="<<area;
getch();
}
L=4
W=5
Area=20
Q4/Write a C++ program to compute the sum of a set of N values.
Q5/Write C++ program to calculate the area of rectangle from this formula a=l*w
#include <iostream.h>
#include <conio.h>
int i,n;
float x,sum;
main()
{
cout<<"N=";
cin>>n;
i=0;
sum=0.;
while (i<n)
{
i=i+1;
cout<<"X=";
cin>>x;
sum=sum+x;
}
cout<<"Sum="<<sum;
getch();
}
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
#include <iostream.h>
#include <conio.h>
int i,n;
float l,w,a;
main()
{
cout<<"N=";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"nL=";
cin>>l;
cout<<"W=";
cin>>w;
a=l*w;
cout<<"Area="<<a;
}
getch();
}
N=3
L=4.5
W=5
Area=22.5
L=5
W=6
Area=30
L=6
W=7
Area=20
Q6/ C++ program to calculate the area of rectangle from this formula a=l*w repeated for n
values of l and w.
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
#include <iostream.h>
#include <conio.h>
int i,n,sum;
main()
{
cout<<"N=";
cin>>n;
sum=0;
for(i=1;i<=n;i++)
{
sum=sum+i;
}
cout<<"Sum="<<sum;
getch();
}
N=12
Sum=78
#include <iostream.h>
#include <conio.h>
int i,n,sum;
main()
{
cout<<"N=";
cin>>n;
i=0;
sum=1;
while(i<n)
{
i=i+1;
sum=sum*i;
}
cout<<"Sum="<<sum;
getch();
} N=5
Sum=120
Q7/Write C++ program to find the value of sum from this formula sum=1+2+3+4+…n
Q8/ Write C++ program to find the value of sum from N! , N! = 1*2*3*4*…n
Try to use (if…else, for, while) for this question Q8/A and B
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
Q11/Write C++ program to read numbers till a negative numbers is entered and calculate
sum of a list of numbers read.
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
#include <iostream.h>
#include <conio.h>
#include <math.h>
int i,x,sum;
main()
{
for(i=1 ; i<=4 ; i++)
{
cout<<”nX=”;
cin>>x;
sum=pow(x,2);
cout<<"Sum="<<sum;
}
getch();
}
X=3
Sum=9
X=4
Sum=16
X=5
Sum=25
X=
Sum=36
Q12/Write C++ program to find the square numbers of a list of 4 numbers.
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
M=3
Y=4
Y=5
Y=7
K=16 E=5.33333
#include <iostream.h>
#include <conio.h>
int j,m;
float k,y,e;
main()
{
k=0.;
cout<<"m=";
cin>>m;
for(j=1 ; j<=m ; j++)
{
cout<<endl<<"Y=";
cin>>y;
k=k+y;
}
e=k/m;
cout<<"K="<<k<<"tE="<<e;
getch();
}
#include <iostream.h>
#include <conio.h>
int j,m;
float k,y,e;
main()
{
k=0.;
cout<<"m=";
cin>>m;
for(j=1 ; j<=m ; j++)
{
cout<<endl<<"Y=";
cin>>y;
k=k+y;
}
e=k/m;
cout<<"K="<<k<<"tE="<<e;
getch();
}
Q13/write a C++ program to produce this result:
M is a set
Y is the numbers of the set
K=K+Y
E=K/M
If we replace “for statement” to “while statement” we write:
PROGRAMMING C++
January 1,
2012
Dr.Selar by:ARAMCS
N=2
2 5
Z=2 Y=4
Z=5 Y=25
#include <iostream.h>
#include <conio.h>
#include <math.h>
int i,n;
float z,y;
main()
{
cout<<"N=";
cin>>n;
for(i=1 ; i<=n ; i++)
{
cin>>z;
y=pow(z,2);
cout<<"Z="<<z<<"tY="<<y<<endl;
}
getch();
}
Q14/write a c++ program to Display on the screen this table

Contenu connexe

Tendances (20)

C++ 4
C++ 4C++ 4
C++ 4
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programs
 
C++ file
C++ fileC++ file
C++ file
 
Sortings
SortingsSortings
Sortings
 
Abebe1
Abebe1Abebe1
Abebe1
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 
C code
C codeC code
C code
 
Bijender (1)
Bijender (1)Bijender (1)
Bijender (1)
 
Modificacion del programa
Modificacion del programaModificacion del programa
Modificacion del programa
 
C++ programs
C++ programsC++ programs
C++ programs
 
Array using recursion
Array using recursionArray using recursion
Array using recursion
 
Problemas de Arreglos en c++
Problemas de Arreglos en c++Problemas de Arreglos en c++
Problemas de Arreglos en c++
 
Experement no 6
Experement no 6Experement no 6
Experement no 6
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
Project_Euler_No_104_Pandigital_Fibonacci_ends
Project_Euler_No_104_Pandigital_Fibonacci_endsProject_Euler_No_104_Pandigital_Fibonacci_ends
Project_Euler_No_104_Pandigital_Fibonacci_ends
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
programs
programsprograms
programs
 
Oop lab report
Oop lab reportOop lab report
Oop lab report
 

En vedette

طريقة عمل ايميل ياهو
طريقة عمل ايميل ياهوطريقة عمل ايميل ياهو
طريقة عمل ايميل ياهوMahmoud Tamous
 
Business in russia
Business in russiaBusiness in russia
Business in russiaAmalieFrom
 
3 matrix in c++ programming aramse
3  matrix in c++ programming aramse3  matrix in c++ programming aramse
3 matrix in c++ programming aramseAram SE
 
Via int. club romania 2
Via int. club   romania 2Via int. club   romania 2
Via int. club romania 2AmalieFrom
 
2 arrays in c++ programming aramse
2  arrays in c++ programming  aramse2  arrays in c++ programming  aramse
2 arrays in c++ programming aramseAram SE
 
تحميل برنامج معرفة مواصفات الكمبيوتر
 تحميل برنامج معرفة مواصفات الكمبيوتر تحميل برنامج معرفة مواصفات الكمبيوتر
تحميل برنامج معرفة مواصفات الكمبيوترMahmoud Tamous
 
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAccess lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAram SE
 
Access lesson 03 Creating Queries
Access lesson 03 Creating QueriesAccess lesson 03 Creating Queries
Access lesson 03 Creating QueriesAram SE
 
TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA cocarroideceba
 
Access lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAccess lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAram SE
 
Access lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAccess lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAram SE
 
C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemnC++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemnAram SE
 
Controle automatico de_processos
Controle automatico de_processosControle automatico de_processos
Controle automatico de_processosWilliam Andrade
 
Access lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access BasicsAccess lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access BasicsAram SE
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scriptingAkshay Siwal
 
Breakfast club oktober 2013
Breakfast club oktober 2013Breakfast club oktober 2013
Breakfast club oktober 2013AmalieFrom
 

En vedette (18)

طريقة عمل ايميل ياهو
طريقة عمل ايميل ياهوطريقة عمل ايميل ياهو
طريقة عمل ايميل ياهو
 
Business in russia
Business in russiaBusiness in russia
Business in russia
 
3 matrix in c++ programming aramse
3  matrix in c++ programming aramse3  matrix in c++ programming aramse
3 matrix in c++ programming aramse
 
Via int. club romania 2
Via int. club   romania 2Via int. club   romania 2
Via int. club romania 2
 
2 arrays in c++ programming aramse
2  arrays in c++ programming  aramse2  arrays in c++ programming  aramse
2 arrays in c++ programming aramse
 
تحميل برنامج معرفة مواصفات الكمبيوتر
 تحميل برنامج معرفة مواصفات الكمبيوتر تحميل برنامج معرفة مواصفات الكمبيوتر
تحميل برنامج معرفة مواصفات الكمبيوتر
 
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAccess lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying Forms
 
Access lesson 03 Creating Queries
Access lesson 03 Creating QueriesAccess lesson 03 Creating Queries
Access lesson 03 Creating Queries
 
TFG BUFF
TFG BUFFTFG BUFF
TFG BUFF
 
TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA
 
85
8585
85
 
Access lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAccess lesson 02 Creating a Database
Access lesson 02 Creating a Database
 
Access lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAccess lesson 02 Creating a Database
Access lesson 02 Creating a Database
 
C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemnC++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemn
 
Controle automatico de_processos
Controle automatico de_processosControle automatico de_processos
Controle automatico de_processos
 
Access lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access BasicsAccess lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access Basics
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scripting
 
Breakfast club oktober 2013
Breakfast club oktober 2013Breakfast club oktober 2013
Breakfast club oktober 2013
 

Similaire à 1 borland c++ 5.02 by aramse

Similaire à 1 borland c++ 5.02 by aramse (20)

Final DAA_prints.pdf
Final DAA_prints.pdfFinal DAA_prints.pdf
Final DAA_prints.pdf
 
7720
77207720
7720
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
C Programming
C ProgrammingC Programming
C Programming
 
C lab
C labC lab
C lab
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
 
Statement
StatementStatement
Statement
 
C++ file
C++ fileC++ file
C++ file
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start se
 
Hargun
HargunHargun
Hargun
 
C
CC
C
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
C Programming
C ProgrammingC Programming
C Programming
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 

Dernier

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Dernier (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

1 borland c++ 5.02 by aramse

  • 1. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS Install Borland C++ 5.02 to your computer First how to open the DOS(standard) to write a C++ program File New Project… ok Target Name: Your name Platform DOS(Standard)ok Double click on Your name or (proj0023.cpp[.cpp])
  • 2. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS #include <iostream.h> #include <conio.h> int x,y; main() { cout<<"X="; cin>>x; cout<<"Y="; cin>>y; if(x>y) cout<<"X is Largest="<<x; else cout<<"Y is Largest="<<y; getch(); } X=4 Y=7 Y is Largest=7 #include <iostream.h> #include <conio.h> int a,b,c; main() { cout<<"Please insert two numbers:n"; cin>>a>>b; cout<<"a="<<a<<" b="<<b; c=b; b=a; a=c; cout<<"nYour Swap is:n"; cout<<"a="<<a<<" b="<<b; getch(); } Please insert two numbers: 3 4 a=3 b=4 Your Swap is: a=4 b=3 Q1/Write a C++ programming to read two values then print out the largest? Q2/Write a C++ program to swap the values of two variables say a,b?
  • 3. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS #include <iostream.h> #include <conio.h> #include <math.h> int x,y,e; main() { cout<<"X="; cin>>x; if(x>0) { cout<<"E="; cin>>e; y=pow(e,x)+5; cout<<"Y="<<y; } else { y=x+7; cout<<"Y="<<y; } getch(); } X=3 E=4 Y=69 X= -4 Y=3 Q3/Write C++ program to evaluate y depending on x value as in the following condition: If x>0 then y=ex +5; If x<0 then y=x+7 Or
  • 4. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS N=3 X=4 X=5 X=6 Sum=15 #include <iostream.h> #include <conio.h> int l,w,area; main() { cout<<”L=”; cin>>l; cout<<”W=”; cin>>w; area=l*w; cout<<"Area="<<area; getch(); } L=4 W=5 Area=20 Q4/Write a C++ program to compute the sum of a set of N values. Q5/Write C++ program to calculate the area of rectangle from this formula a=l*w #include <iostream.h> #include <conio.h> int i,n; float x,sum; main() { cout<<"N="; cin>>n; i=0; sum=0.; while (i<n) { i=i+1; cout<<"X="; cin>>x; sum=sum+x; } cout<<"Sum="<<sum; getch(); }
  • 5. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS #include <iostream.h> #include <conio.h> int i,n; float l,w,a; main() { cout<<"N="; cin>>n; for(i=1;i<=n;i++) { cout<<"nL="; cin>>l; cout<<"W="; cin>>w; a=l*w; cout<<"Area="<<a; } getch(); } N=3 L=4.5 W=5 Area=22.5 L=5 W=6 Area=30 L=6 W=7 Area=20 Q6/ C++ program to calculate the area of rectangle from this formula a=l*w repeated for n values of l and w.
  • 6. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS #include <iostream.h> #include <conio.h> int i,n,sum; main() { cout<<"N="; cin>>n; sum=0; for(i=1;i<=n;i++) { sum=sum+i; } cout<<"Sum="<<sum; getch(); } N=12 Sum=78 #include <iostream.h> #include <conio.h> int i,n,sum; main() { cout<<"N="; cin>>n; i=0; sum=1; while(i<n) { i=i+1; sum=sum*i; } cout<<"Sum="<<sum; getch(); } N=5 Sum=120 Q7/Write C++ program to find the value of sum from this formula sum=1+2+3+4+…n Q8/ Write C++ program to find the value of sum from N! , N! = 1*2*3*4*…n Try to use (if…else, for, while) for this question Q8/A and B
  • 7. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS Q11/Write C++ program to read numbers till a negative numbers is entered and calculate sum of a list of numbers read.
  • 8. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS #include <iostream.h> #include <conio.h> #include <math.h> int i,x,sum; main() { for(i=1 ; i<=4 ; i++) { cout<<”nX=”; cin>>x; sum=pow(x,2); cout<<"Sum="<<sum; } getch(); } X=3 Sum=9 X=4 Sum=16 X=5 Sum=25 X= Sum=36 Q12/Write C++ program to find the square numbers of a list of 4 numbers.
  • 9. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS M=3 Y=4 Y=5 Y=7 K=16 E=5.33333 #include <iostream.h> #include <conio.h> int j,m; float k,y,e; main() { k=0.; cout<<"m="; cin>>m; for(j=1 ; j<=m ; j++) { cout<<endl<<"Y="; cin>>y; k=k+y; } e=k/m; cout<<"K="<<k<<"tE="<<e; getch(); } #include <iostream.h> #include <conio.h> int j,m; float k,y,e; main() { k=0.; cout<<"m="; cin>>m; for(j=1 ; j<=m ; j++) { cout<<endl<<"Y="; cin>>y; k=k+y; } e=k/m; cout<<"K="<<k<<"tE="<<e; getch(); } Q13/write a C++ program to produce this result: M is a set Y is the numbers of the set K=K+Y E=K/M If we replace “for statement” to “while statement” we write:
  • 10. PROGRAMMING C++ January 1, 2012 Dr.Selar by:ARAMCS N=2 2 5 Z=2 Y=4 Z=5 Y=25 #include <iostream.h> #include <conio.h> #include <math.h> int i,n; float z,y; main() { cout<<"N="; cin>>n; for(i=1 ; i<=n ; i++) { cin>>z; y=pow(z,2); cout<<"Z="<<z<<"tY="<<y<<endl; } getch(); } Q14/write a c++ program to Display on the screen this table