SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Write a Program that does the following:-
- Promotes the user to enter 5 numbers.
- Print the Numbers.
- Print the sum and average of these five numbers.
#include<iostream.h>
void main()
{
int a,b,c,d,e,sum,avg;
cout<<"Enter the five numbers:";
cin>>a>>b>>c>>d>>e;
cout<<"the numbers you have entered are: ";
cout<<a<<" "<<b<<" ";
cout<<c<<" "<<d<<" "<<e<<endl;
sum = a + b + c + d + e;
avg = sum/5;
cout<<"the sum is "<<sum;
cout<<" and the average is "<<avg<<endl;
}
2
Write a Program that promotes the user to enter the length and
width of a rectangle and print its area.
#include <iostream.h>
void main()
{
double length,width;
cout<<"Enter the Length an the Width of the rectangle:";
cin>>length>>width;
cout<<"the area of the rectangle is "<<length*width<<endl;
}
3
Write a Program that finds the area of a circle.
#include <iostream.h>
void main()
{
const float PI = 3.14;
double r;
cout<<"Enter the Radius of the Circle:";
cin>>r;
cout<<"the area of the Circle is "<<PI*r*r<<endl;
}
4
Write a Program to find the absolute value of
an integer
#include <iostream.h>
void main()
{
int a;
cout<<"enter a number:";
cin>>a;
if(a<0)
a *= -1;
cout<<"the absolute value of the number is: "<<a<<endl;
}
5
Write a Program that reads two different integers
and print the largest
#include <iostream.h>
void main()
{
int a,b;
cout<<"enter two numbers:";
cin>>a>>b;
if(a>b)
cout<<a<<" is the largest"<<endl;
else
cout<<b<<" is the largest"<<endl;
}
6
Write a Program that reads operation with it's operands
and then print the result
#include <iostream.h>
void main()
{
double a,b;
char x;
cout<<"enter the operation:";
cin>>a>>x>>b;
if(x=='+')
cout<<a+b<<endl;
else if (x=='-')
cout<<a-b<<endl;
else if (x=='*')
cout<<a*b<<endl;
else if (x=='/')
cout<<a/b<<endl;
else
cout<<"Unknown operation"<<endl;
}
7
Write a Program to read a character if it's in alphabet then
find if it’s uppercase or lowercase. If it’s a digit print that it
is a digit.
Else print that it’s a special character.
#include <iostream.h>
void main()
{
char x;
cout<<"enter the char:";
cin>>x;
if(x>='A' && x<='Z')
cout<<x<<" is Uppercase char"<<endl;
else if(x>='a' && x<='z')
cout<<x<<" is Lowercase char"<<endl;
else if(x>='0' && x<='9')
cout<<x<<" is a Digit"<<endl;
else
cout<<x<<" is a special char"<<endl;
}
8
Write a loop to print the numbers from 1 to 10
#include <iostream.h>
void main()
{
int i = 0;
while(i<=10)
cout<<i++<<endl;
}
9
Write a Program to print the multiple of number 5
between 0 to 20
#include <iostream.h>
void main()
{
int i = 5;
while(i<=20)
{
cout<<i<<endl;
i+=5;
}
}
10
Write a loop to find the sum of numbers from 1 to 20
#include <iostream.h>
void main()
{
int sum=0,i = 0;
while(i<=20)
sum +=i++;
cout<<"the sum is: "<<sum<<endl;
}
11
Write a loop to find the sum of odd numbers from
20 to 300
#include <iostream.h>
void main()
{
int i = 20,sum = 0;
while(i<=300)
{
if(i%2==1)
sum += i;
i++;
}
cout<<"the sum is: "<<sum<<endl;
}
12
Find the sum of even number from 1 to 30
#include <iostream.h>
void main()
{
int i = 1,sum = 0;
while(i<=30)
{
if(i%2==0)
sum += i;
i++;
}
cout<<"the sum is: "<<sum<<endl;
}
13
Write a loop to find factorials for an entered number
#include <iostream.h>
void main()
{
int x,y;
cout<<"enter the number:";
cin>>x;
y=x;
while(x!=0)
{
if(y%x==0)
cout<<x<<endl;
x--;
}
}
14
Find the maximum between 20 numbers
#include <iostream.h>
void main()
{
int x,y;
cout<<"enter the number:";
cin>>x;
int i = 0;
while(i<=20)
{
if(x>y)
{
y =x;
cout<<"the Maximum until now is "<<y<<endl;
}
cin>>x;
i++;
}
} 15
Write a for loop to print number 1 to 40 each 5 on line
#include <iostream.h>
#include <iomanip.h>
void main()
{
for(int i=1;i<=40;i++)
{
cout<<setw(3)<<i;
if(i%5==0)
cout<<endl;
}
}
16
Write a Program that reads a number and perform the following
- print the number digits in reverse order.
- Find the sum of it's digits.
- Find the average of it's digits
#include<iostream>
#include<iomanip>
using namespace std;
void main()
{
int x,y,z=0,avg=0,sum=0;
cin>>x;
while(x!=0)
{
y = x%10;
x/=10;
cout<<y<<endl;
sum += y;
z++;
}
avg = sum/z;
cout<<"the sum is "<<sum<<endl;
cout<<"the avg is "<<avg<<endl;
} 17
Write a Program to read a set of non zero(when read zero, stop the program)
and find:
sum – average - maximum value - minimum value -
the number of values - sum of numbers that divide on 5
#include<iostream>
#include<iomanip>
using namespace std;
void main()
{
int x,y,max,min,z=0,avg=0,sum=0,sum5=0;
cin>>x;
max = x;
min = x;
while(x!=0)
{
if(x>max)
max = x;
if(x<min)
min =x; 18
19
sum+=x;
z++;
if(x%5==0)
sum5+=x;
cin>>x;
}
avg = sum/z;
cout<<"the sum is "<<sum<<endl;
cout<<"the average is "<<avg<<endl;
cout<<"the maximum value is "<<max<<endl;
cout<<"the minimum value is "<<min<<endl;
cout<<"the numbers of values is "<<z<<endl;
cout<<"the sum of numbers that divide on 5 is
"<<sum5<<endl;
}
Write a Loop that draws the following shape:
*
**
***
****
*****
#include<iostream.h>
void main()
{
for(int i = 0;i<5;i++)
{
for(int j = 0;j<=i;j++)
cout<<'*';
cout<<endl;
}
}
20
Write a Loop that draws the following shape
#include<iostream.h>
void main()
{
for(int i = 1;i<=3;i++)
{
for(int j =1;j<=3-i;j++)
cout<<' ';
for(int k = 1;k<=(2*i)-1;k++)
cout<<'*';
cout<<endl;
}
}
21
‫المدخل‬ ‫للعدد‬ ‫الصفر‬ ‫من‬ ‫الزوجية‬ ‫األعداد‬ ‫طباعة‬
#include <iostream.h>
int main()
{
int i,num;
cout<<"Enter the last number : ";
cin>>num;
for (i=0;i<=num;i++)
if (i%2==0)
cout<<i<<" ";
cout<<endl;
return 0;
}
22
‫المدخل‬ ‫للعدد‬ ‫الصفر‬ ‫من‬ ‫الفردية‬ ‫األعداد‬ ‫طباعة‬:
#include <iostream.h>
int main()
{
int i,num;
cout<<"Enter the last number : ";
cin>>num;
for (i=0;i<=num;i++)
if (i%2!=0)
cout<<i<<" ";
cout<<endl;
return 0;
}
23
‫العدد‬ ‫ذلك‬ ‫هو‬ ‫ويختبر‬ ‫عدد‬ ‫أي‬ ‫بإدخال‬ ‫أنت‬ ‫تقوم‬ ‫برنامج‬
‫صفر‬ ‫أو‬ ‫سالب‬ ‫أو‬ ‫موجب‬ ‫أنه‬ ‫حيث‬ ‫من‬..
#include <iostream.h>
int main()
{
float num;
cout<<"Enter the number : ";
cin>>num;
if(num>0)
cout<<num <<" is Positive Number"<<endl;
else if(num<0)
cout<<num <<" is Negative Number"<<endl;
else
cout<<num<<" is Zero"<<endl;
return 0;
}
24
‫برنامج‬‫ويقوم‬ ‫أرقام‬ ‫عشرة‬ ‫بإدخال‬ ‫خالله‬ ‫من‬ ‫تقوم‬
‫بينهم‬ ‫عدد‬ ‫وأصغر‬ ‫أكبر‬ ‫بإيجاد‬ ‫هو‬:
#include<iostream.h>
int main()
{
float num,max=0,min=3200;
cout<<"Enter 10 numbers : ";
for(int i=0;i<10;i++)
{
cin>>num;
if(max<num)
max=num;
if(min>num)
min=num;
}
cout<<"The Maximum Numbers is : "<<max<<endl;
cout<<"The Minimum Numbers is : "<<min<<endl;
return 0;
}
25
‫منهما‬ ‫األكبر‬ ‫ويوجد‬ ‫عددين‬ ‫بإدخال‬ ‫تقوم‬:‫أخرى‬ ‫بطريقة‬:
#include<iostream.h>
int main()
{
float num1,num2,max;
cout<<"Enter num1 : ";
cin>>num1;
cout<<"Enter num2 : ";
cin>>num2;
max=(num1>=num2)?num1:num2;
cout<<"The Maximum Numbers is : "<<max<<endl;
return 0;
}
26
‫بينهما‬ ‫األصغر‬ ‫ويوجد‬ ‫عددين‬ ‫بإدخال‬ ‫تقوم‬:
#include<iostream.h>
int main()
{
float num1,num2,min;
cout<<"Enter num1 : ";
cin>>num1;
cout<<"Enter num2 : ";
cin>>num2;
min=(num1<=num2)?num1:num2;
cout<<"The Minimum Numbers is : "<<min<<endl;
return 0;
}
27
‫يقوم‬ ‫ثم‬ ‫الباسوورد‬ ‫إدخال‬ ‫المستخدم‬ ‫من‬ ‫يطلب‬ ‫برنامج‬
‫باختباره‬..
#include<iostream.h>
#include<string.h>
int main()
{
const char a[6]="admin";
char pass[6];
cout<<"Enter Your Password : ";
cin>>pass;
if(strcmp(pass,a)==0)
cout<<"Welcom to my Program.."<<endl;
else
cout<<"You are Not Allowed to Access This Program"<<endl;
return 0;
}
28
‫المضروب‬
include <iostream.h>#
int main()
{
int num,fact=1;
cout<<"Enter The Number: ";
cin>>num;
for(int i=2;i<=num;i++)
fact*=i;//fact=fact*i
cout<<"Factorial = "<<fact<<endl;
return 0;
}
29
‫باستخدام‬ ‫المضروب‬while:
#include <iostream.h>
int main()
{
int i=1,num,fact=1;
cout<<"Enter The Number: ";
cin>>num;
while(i<=num)
{
fact*=i;//fact=fact*i
i++;
}
cout<<"Factorial = "<<fact<<endl;
return 0;
}
30
‫األعداد‬ ‫من‬ ‫مجموعة‬ ‫إدخال‬ ‫المستخدم‬ ‫من‬ ‫يطلب‬ ‫برنامج‬
‫لهذه‬ ‫المتوسط‬ ‫بحساب‬ ‫يقوم‬ ‫ثم‬ ‫بالصفر‬ ‫تنتهي‬
‫يتجاهله‬ ‫فإنه‬ ‫سالب‬ ‫عدد‬ ‫صادف‬ ‫وإذا‬ ‫األعداد‬
‫باستخدام‬ ‫الحسبان‬ ‫في‬ ‫واليضعه‬Continue‫ثم‬
‫العملية‬ ‫يكمل‬
#include<iostream.h>
int main()
{
int x,sum=0,count=0;
cout<<"Enter the numbers : "<<endl;
for (;;)
{
cin>>x;
count+=1;
if (x<0)
{
count-=1;
continue;
}
else
sum=sum+x;
31
32
if(x==0)
{
count-=1;
break;
}
}
cout<<"The Avarege = "<<sum/count<<endl;
return 0;
}
‫طريق‬ ‫عن‬ ‫المستطيل‬ ‫مساحة‬ ‫بحساب‬ ‫يقوم‬ ‫برنامج‬
‫بالحساب‬ ‫يقوم‬ ‫آخر‬ ‫بروسيجر‬ ‫استدعاء‬..
#include<iostream.h>
float cal(float length,float width);
void main()
{
float length,width,area;
cout<<"Enter the rectangle length:";
cin>>length;
cout<<"Enter the rectangle width:";
cin>>width;
area=cal(length,width);
cout<<"Rectangle Area = "<<area<<endl;
}
float cal(float length,float width)
{
float w;
w = length * width;
return w;
}
33
‫بطباعة‬ ‫هو‬ ‫يقوم‬ ‫ثم‬ ‫أسمك‬ ‫بإدخال‬ ‫انت‬ ‫تقوم‬ ‫برنامج‬
‫ادخلته‬ ‫الذي‬ ‫اسمك‬ ‫فيه‬ ‫يظهر‬ ‫ترحيبيه‬ ‫عبارة‬.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name;
cout<<"Enter your name: ";
cin>>name;
cout<<"Hello "<<name<<endl;
return 0;
}
34

Más contenido relacionado

La actualidad más candente

C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st StudyChris Ohk
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - HarshHarsh Sharma
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++Bharat Kalia
 
Best C Programming Solution
Best C Programming SolutionBest C Programming Solution
Best C Programming Solutionyogini sharma
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILEAnushka Rai
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
Oops practical file
Oops practical fileOops practical file
Oops practical fileAnkit Dixit
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control StructureMohammad Shaker
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd StudyChris Ohk
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
 

La actualidad más candente (20)

C++ TUTORIAL 10
C++ TUTORIAL 10C++ TUTORIAL 10
C++ TUTORIAL 10
 
Cs project
Cs projectCs project
Cs project
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
C++ TUTORIAL 7
C++ TUTORIAL 7C++ TUTORIAL 7
C++ TUTORIAL 7
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
C++ file
C++ fileC++ file
C++ file
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
 
SaraPIC
SaraPICSaraPIC
SaraPIC
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Best C Programming Solution
Best C Programming SolutionBest C Programming Solution
Best C Programming Solution
 
String
StringString
String
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
Stl algorithm-Basic types
Stl algorithm-Basic typesStl algorithm-Basic types
Stl algorithm-Basic types
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
 

Destacado

Present simple.silvia viloria
Present simple.silvia viloriaPresent simple.silvia viloria
Present simple.silvia viloriaSilvia Viloria
 
Core marketing concepts
Core marketing conceptsCore marketing concepts
Core marketing conceptsvikas sharma
 
الشرقية قيكس سنة من الإنجازات
الشرقية قيكس سنة من الإنجازاتالشرقية قيكس سنة من الإنجازات
الشرقية قيكس سنة من الإنجازاتlunarhalo
 
CancerRegistry PosterFINAL 091208
CancerRegistry PosterFINAL 091208CancerRegistry PosterFINAL 091208
CancerRegistry PosterFINAL 091208Tim Zens
 
González uscanga keila samantha dhtic19 tarea5
González uscanga keila samantha dhtic19 tarea5González uscanga keila samantha dhtic19 tarea5
González uscanga keila samantha dhtic19 tarea5Keila Gonzalez Uscanga
 
Wc Prima 4X4 par Allia salle de bains
Wc Prima 4X4 par Allia salle de bainsWc Prima 4X4 par Allia salle de bains
Wc Prima 4X4 par Allia salle de bainsAllia_Salle_De_Bains
 
Renato Rinaldi e Andrea Collavino, Memoria di massa
Renato Rinaldi e Andrea Collavino, Memoria di massaRenato Rinaldi e Andrea Collavino, Memoria di massa
Renato Rinaldi e Andrea Collavino, Memoria di massaPatrimonio culturale FVG
 
Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...
Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...
Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...Patrimonio culturale FVG
 
تجربتي مع مجموعة عقال
 تجربتي مع مجموعة عقال  تجربتي مع مجموعة عقال
تجربتي مع مجموعة عقال lunarhalo
 
N 20141112 una obra digna - fuente mayucu (x)
N 20141112  una obra digna - fuente mayucu (x)N 20141112  una obra digna - fuente mayucu (x)
N 20141112 una obra digna - fuente mayucu (x)rubindecelis32
 
Base de datos access 2010
Base de datos access 2010Base de datos access 2010
Base de datos access 2010AndresJulian32
 
Holding di Famiglia e Passaggio Generazionale
Holding di Famiglia e Passaggio GenerazionaleHolding di Famiglia e Passaggio Generazionale
Holding di Famiglia e Passaggio GenerazionaleEdoardo Tamagnone
 
ملخص تقنية تصميم صفحات الويب - الوحدة الخامسة
ملخص تقنية تصميم صفحات الويب - الوحدة الخامسةملخص تقنية تصميم صفحات الويب - الوحدة الخامسة
ملخص تقنية تصميم صفحات الويب - الوحدة الخامسةجامعة القدس المفتوحة
 
Análisis de Mercado - Caso Iberia
Análisis de Mercado - Caso IberiaAnálisis de Mercado - Caso Iberia
Análisis de Mercado - Caso IberiaWalid Hakiri
 
Ch1 defining marketing for the 21st century abendan
Ch1 defining marketing for the 21st century abendanCh1 defining marketing for the 21st century abendan
Ch1 defining marketing for the 21st century abendanriaabendan
 

Destacado (19)

Present simple.silvia viloria
Present simple.silvia viloriaPresent simple.silvia viloria
Present simple.silvia viloria
 
Core marketing concepts
Core marketing conceptsCore marketing concepts
Core marketing concepts
 
الشرقية قيكس سنة من الإنجازات
الشرقية قيكس سنة من الإنجازاتالشرقية قيكس سنة من الإنجازات
الشرقية قيكس سنة من الإنجازات
 
CancerRegistry PosterFINAL 091208
CancerRegistry PosterFINAL 091208CancerRegistry PosterFINAL 091208
CancerRegistry PosterFINAL 091208
 
González uscanga keila samantha dhtic19 tarea5
González uscanga keila samantha dhtic19 tarea5González uscanga keila samantha dhtic19 tarea5
González uscanga keila samantha dhtic19 tarea5
 
Tecnicas ventas hurtado
Tecnicas ventas hurtadoTecnicas ventas hurtado
Tecnicas ventas hurtado
 
Harappa e Mohenjo Daro
Harappa e Mohenjo DaroHarappa e Mohenjo Daro
Harappa e Mohenjo Daro
 
Wc Prima 4X4 par Allia salle de bains
Wc Prima 4X4 par Allia salle de bainsWc Prima 4X4 par Allia salle de bains
Wc Prima 4X4 par Allia salle de bains
 
Renato Rinaldi e Andrea Collavino, Memoria di massa
Renato Rinaldi e Andrea Collavino, Memoria di massaRenato Rinaldi e Andrea Collavino, Memoria di massa
Renato Rinaldi e Andrea Collavino, Memoria di massa
 
Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...
Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...
Web e social network nella PA: #culturavivafvg, raccontare il patrimonio cult...
 
تجربتي مع مجموعة عقال
 تجربتي مع مجموعة عقال  تجربتي مع مجموعة عقال
تجربتي مع مجموعة عقال
 
Lavoro autonomo abituale
Lavoro autonomo abitualeLavoro autonomo abituale
Lavoro autonomo abituale
 
Il concetto di guerra dall'antichità al medioevo
Il concetto di guerra dall'antichità al medioevoIl concetto di guerra dall'antichità al medioevo
Il concetto di guerra dall'antichità al medioevo
 
N 20141112 una obra digna - fuente mayucu (x)
N 20141112  una obra digna - fuente mayucu (x)N 20141112  una obra digna - fuente mayucu (x)
N 20141112 una obra digna - fuente mayucu (x)
 
Base de datos access 2010
Base de datos access 2010Base de datos access 2010
Base de datos access 2010
 
Holding di Famiglia e Passaggio Generazionale
Holding di Famiglia e Passaggio GenerazionaleHolding di Famiglia e Passaggio Generazionale
Holding di Famiglia e Passaggio Generazionale
 
ملخص تقنية تصميم صفحات الويب - الوحدة الخامسة
ملخص تقنية تصميم صفحات الويب - الوحدة الخامسةملخص تقنية تصميم صفحات الويب - الوحدة الخامسة
ملخص تقنية تصميم صفحات الويب - الوحدة الخامسة
 
Análisis de Mercado - Caso Iberia
Análisis de Mercado - Caso IberiaAnálisis de Mercado - Caso Iberia
Análisis de Mercado - Caso Iberia
 
Ch1 defining marketing for the 21st century abendan
Ch1 defining marketing for the 21st century abendanCh1 defining marketing for the 21st century abendan
Ch1 defining marketing for the 21st century abendan
 

Similar a 10 template code program

Solved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ ExamsSolved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ ExamsMuhammadTalha436
 
C101-PracticeProblems.pdf
C101-PracticeProblems.pdfC101-PracticeProblems.pdf
C101-PracticeProblems.pdfT17Rockstar
 
Practiceproblems(1)
Practiceproblems(1)Practiceproblems(1)
Practiceproblems(1)Sena Nama
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solvingSyed Umair
 
Please use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfPlease use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfseoagam1
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.pptEPORI
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++cpjcollege
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++Marco Izzotti
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.pptLokeshK66
 
Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using cArghodeepPaul
 

Similar a 10 template code program (20)

Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
Solved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ ExamsSolved Practice Problems For the C++ Exams
Solved Practice Problems For the C++ Exams
 
Statement
StatementStatement
Statement
 
C101-PracticeProblems.pdf
C101-PracticeProblems.pdfC101-PracticeProblems.pdf
C101-PracticeProblems.pdf
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
Practiceproblems(1)
Practiceproblems(1)Practiceproblems(1)
Practiceproblems(1)
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
Project in programming
Project in programmingProject in programming
Project in programming
 
Please use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfPlease use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdf
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
C++basics
C++basicsC++basics
C++basics
 
C++basics
C++basicsC++basics
C++basics
 
c++basiccs.ppt
c++basiccs.pptc++basiccs.ppt
c++basiccs.ppt
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
 
Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using c
 

Más de Bint EL-maghrabi (9)

9 message error
9 message error9 message error
9 message error
 
8 header files
8 header files8 header files
8 header files
 
7 functions
7 functions7 functions
7 functions
 
5 loops
5 loops5 loops
5 loops
 
4 flow control statements
4 flow control statements4 flow control statements
4 flow control statements
 
3 operators
3 operators3 operators
3 operators
 
2 variables and constants
2 variables and constants2 variables and constants
2 variables and constants
 
6 arrays
6 arrays6 arrays
6 arrays
 
01 Introduction in C++
01 Introduction in C++01 Introduction in C++
01 Introduction in C++
 

Último

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Último (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

10 template code program

  • 1.
  • 2. Write a Program that does the following:- - Promotes the user to enter 5 numbers. - Print the Numbers. - Print the sum and average of these five numbers. #include<iostream.h> void main() { int a,b,c,d,e,sum,avg; cout<<"Enter the five numbers:"; cin>>a>>b>>c>>d>>e; cout<<"the numbers you have entered are: "; cout<<a<<" "<<b<<" "; cout<<c<<" "<<d<<" "<<e<<endl; sum = a + b + c + d + e; avg = sum/5; cout<<"the sum is "<<sum; cout<<" and the average is "<<avg<<endl; } 2
  • 3. Write a Program that promotes the user to enter the length and width of a rectangle and print its area. #include <iostream.h> void main() { double length,width; cout<<"Enter the Length an the Width of the rectangle:"; cin>>length>>width; cout<<"the area of the rectangle is "<<length*width<<endl; } 3
  • 4. Write a Program that finds the area of a circle. #include <iostream.h> void main() { const float PI = 3.14; double r; cout<<"Enter the Radius of the Circle:"; cin>>r; cout<<"the area of the Circle is "<<PI*r*r<<endl; } 4
  • 5. Write a Program to find the absolute value of an integer #include <iostream.h> void main() { int a; cout<<"enter a number:"; cin>>a; if(a<0) a *= -1; cout<<"the absolute value of the number is: "<<a<<endl; } 5
  • 6. Write a Program that reads two different integers and print the largest #include <iostream.h> void main() { int a,b; cout<<"enter two numbers:"; cin>>a>>b; if(a>b) cout<<a<<" is the largest"<<endl; else cout<<b<<" is the largest"<<endl; } 6
  • 7. Write a Program that reads operation with it's operands and then print the result #include <iostream.h> void main() { double a,b; char x; cout<<"enter the operation:"; cin>>a>>x>>b; if(x=='+') cout<<a+b<<endl; else if (x=='-') cout<<a-b<<endl; else if (x=='*') cout<<a*b<<endl; else if (x=='/') cout<<a/b<<endl; else cout<<"Unknown operation"<<endl; } 7
  • 8. Write a Program to read a character if it's in alphabet then find if it’s uppercase or lowercase. If it’s a digit print that it is a digit. Else print that it’s a special character. #include <iostream.h> void main() { char x; cout<<"enter the char:"; cin>>x; if(x>='A' && x<='Z') cout<<x<<" is Uppercase char"<<endl; else if(x>='a' && x<='z') cout<<x<<" is Lowercase char"<<endl; else if(x>='0' && x<='9') cout<<x<<" is a Digit"<<endl; else cout<<x<<" is a special char"<<endl; } 8
  • 9. Write a loop to print the numbers from 1 to 10 #include <iostream.h> void main() { int i = 0; while(i<=10) cout<<i++<<endl; } 9
  • 10. Write a Program to print the multiple of number 5 between 0 to 20 #include <iostream.h> void main() { int i = 5; while(i<=20) { cout<<i<<endl; i+=5; } } 10
  • 11. Write a loop to find the sum of numbers from 1 to 20 #include <iostream.h> void main() { int sum=0,i = 0; while(i<=20) sum +=i++; cout<<"the sum is: "<<sum<<endl; } 11
  • 12. Write a loop to find the sum of odd numbers from 20 to 300 #include <iostream.h> void main() { int i = 20,sum = 0; while(i<=300) { if(i%2==1) sum += i; i++; } cout<<"the sum is: "<<sum<<endl; } 12
  • 13. Find the sum of even number from 1 to 30 #include <iostream.h> void main() { int i = 1,sum = 0; while(i<=30) { if(i%2==0) sum += i; i++; } cout<<"the sum is: "<<sum<<endl; } 13
  • 14. Write a loop to find factorials for an entered number #include <iostream.h> void main() { int x,y; cout<<"enter the number:"; cin>>x; y=x; while(x!=0) { if(y%x==0) cout<<x<<endl; x--; } } 14
  • 15. Find the maximum between 20 numbers #include <iostream.h> void main() { int x,y; cout<<"enter the number:"; cin>>x; int i = 0; while(i<=20) { if(x>y) { y =x; cout<<"the Maximum until now is "<<y<<endl; } cin>>x; i++; } } 15
  • 16. Write a for loop to print number 1 to 40 each 5 on line #include <iostream.h> #include <iomanip.h> void main() { for(int i=1;i<=40;i++) { cout<<setw(3)<<i; if(i%5==0) cout<<endl; } } 16
  • 17. Write a Program that reads a number and perform the following - print the number digits in reverse order. - Find the sum of it's digits. - Find the average of it's digits #include<iostream> #include<iomanip> using namespace std; void main() { int x,y,z=0,avg=0,sum=0; cin>>x; while(x!=0) { y = x%10; x/=10; cout<<y<<endl; sum += y; z++; } avg = sum/z; cout<<"the sum is "<<sum<<endl; cout<<"the avg is "<<avg<<endl; } 17
  • 18. Write a Program to read a set of non zero(when read zero, stop the program) and find: sum – average - maximum value - minimum value - the number of values - sum of numbers that divide on 5 #include<iostream> #include<iomanip> using namespace std; void main() { int x,y,max,min,z=0,avg=0,sum=0,sum5=0; cin>>x; max = x; min = x; while(x!=0) { if(x>max) max = x; if(x<min) min =x; 18
  • 19. 19 sum+=x; z++; if(x%5==0) sum5+=x; cin>>x; } avg = sum/z; cout<<"the sum is "<<sum<<endl; cout<<"the average is "<<avg<<endl; cout<<"the maximum value is "<<max<<endl; cout<<"the minimum value is "<<min<<endl; cout<<"the numbers of values is "<<z<<endl; cout<<"the sum of numbers that divide on 5 is "<<sum5<<endl; }
  • 20. Write a Loop that draws the following shape: * ** *** **** ***** #include<iostream.h> void main() { for(int i = 0;i<5;i++) { for(int j = 0;j<=i;j++) cout<<'*'; cout<<endl; } } 20
  • 21. Write a Loop that draws the following shape #include<iostream.h> void main() { for(int i = 1;i<=3;i++) { for(int j =1;j<=3-i;j++) cout<<' '; for(int k = 1;k<=(2*i)-1;k++) cout<<'*'; cout<<endl; } } 21
  • 22. ‫المدخل‬ ‫للعدد‬ ‫الصفر‬ ‫من‬ ‫الزوجية‬ ‫األعداد‬ ‫طباعة‬ #include <iostream.h> int main() { int i,num; cout<<"Enter the last number : "; cin>>num; for (i=0;i<=num;i++) if (i%2==0) cout<<i<<" "; cout<<endl; return 0; } 22
  • 23. ‫المدخل‬ ‫للعدد‬ ‫الصفر‬ ‫من‬ ‫الفردية‬ ‫األعداد‬ ‫طباعة‬: #include <iostream.h> int main() { int i,num; cout<<"Enter the last number : "; cin>>num; for (i=0;i<=num;i++) if (i%2!=0) cout<<i<<" "; cout<<endl; return 0; } 23
  • 24. ‫العدد‬ ‫ذلك‬ ‫هو‬ ‫ويختبر‬ ‫عدد‬ ‫أي‬ ‫بإدخال‬ ‫أنت‬ ‫تقوم‬ ‫برنامج‬ ‫صفر‬ ‫أو‬ ‫سالب‬ ‫أو‬ ‫موجب‬ ‫أنه‬ ‫حيث‬ ‫من‬.. #include <iostream.h> int main() { float num; cout<<"Enter the number : "; cin>>num; if(num>0) cout<<num <<" is Positive Number"<<endl; else if(num<0) cout<<num <<" is Negative Number"<<endl; else cout<<num<<" is Zero"<<endl; return 0; } 24
  • 25. ‫برنامج‬‫ويقوم‬ ‫أرقام‬ ‫عشرة‬ ‫بإدخال‬ ‫خالله‬ ‫من‬ ‫تقوم‬ ‫بينهم‬ ‫عدد‬ ‫وأصغر‬ ‫أكبر‬ ‫بإيجاد‬ ‫هو‬: #include<iostream.h> int main() { float num,max=0,min=3200; cout<<"Enter 10 numbers : "; for(int i=0;i<10;i++) { cin>>num; if(max<num) max=num; if(min>num) min=num; } cout<<"The Maximum Numbers is : "<<max<<endl; cout<<"The Minimum Numbers is : "<<min<<endl; return 0; } 25
  • 26. ‫منهما‬ ‫األكبر‬ ‫ويوجد‬ ‫عددين‬ ‫بإدخال‬ ‫تقوم‬:‫أخرى‬ ‫بطريقة‬: #include<iostream.h> int main() { float num1,num2,max; cout<<"Enter num1 : "; cin>>num1; cout<<"Enter num2 : "; cin>>num2; max=(num1>=num2)?num1:num2; cout<<"The Maximum Numbers is : "<<max<<endl; return 0; } 26
  • 27. ‫بينهما‬ ‫األصغر‬ ‫ويوجد‬ ‫عددين‬ ‫بإدخال‬ ‫تقوم‬: #include<iostream.h> int main() { float num1,num2,min; cout<<"Enter num1 : "; cin>>num1; cout<<"Enter num2 : "; cin>>num2; min=(num1<=num2)?num1:num2; cout<<"The Minimum Numbers is : "<<min<<endl; return 0; } 27
  • 28. ‫يقوم‬ ‫ثم‬ ‫الباسوورد‬ ‫إدخال‬ ‫المستخدم‬ ‫من‬ ‫يطلب‬ ‫برنامج‬ ‫باختباره‬.. #include<iostream.h> #include<string.h> int main() { const char a[6]="admin"; char pass[6]; cout<<"Enter Your Password : "; cin>>pass; if(strcmp(pass,a)==0) cout<<"Welcom to my Program.."<<endl; else cout<<"You are Not Allowed to Access This Program"<<endl; return 0; } 28
  • 29. ‫المضروب‬ include <iostream.h># int main() { int num,fact=1; cout<<"Enter The Number: "; cin>>num; for(int i=2;i<=num;i++) fact*=i;//fact=fact*i cout<<"Factorial = "<<fact<<endl; return 0; } 29
  • 30. ‫باستخدام‬ ‫المضروب‬while: #include <iostream.h> int main() { int i=1,num,fact=1; cout<<"Enter The Number: "; cin>>num; while(i<=num) { fact*=i;//fact=fact*i i++; } cout<<"Factorial = "<<fact<<endl; return 0; } 30
  • 31. ‫األعداد‬ ‫من‬ ‫مجموعة‬ ‫إدخال‬ ‫المستخدم‬ ‫من‬ ‫يطلب‬ ‫برنامج‬ ‫لهذه‬ ‫المتوسط‬ ‫بحساب‬ ‫يقوم‬ ‫ثم‬ ‫بالصفر‬ ‫تنتهي‬ ‫يتجاهله‬ ‫فإنه‬ ‫سالب‬ ‫عدد‬ ‫صادف‬ ‫وإذا‬ ‫األعداد‬ ‫باستخدام‬ ‫الحسبان‬ ‫في‬ ‫واليضعه‬Continue‫ثم‬ ‫العملية‬ ‫يكمل‬ #include<iostream.h> int main() { int x,sum=0,count=0; cout<<"Enter the numbers : "<<endl; for (;;) { cin>>x; count+=1; if (x<0) { count-=1; continue; } else sum=sum+x; 31
  • 33. ‫طريق‬ ‫عن‬ ‫المستطيل‬ ‫مساحة‬ ‫بحساب‬ ‫يقوم‬ ‫برنامج‬ ‫بالحساب‬ ‫يقوم‬ ‫آخر‬ ‫بروسيجر‬ ‫استدعاء‬.. #include<iostream.h> float cal(float length,float width); void main() { float length,width,area; cout<<"Enter the rectangle length:"; cin>>length; cout<<"Enter the rectangle width:"; cin>>width; area=cal(length,width); cout<<"Rectangle Area = "<<area<<endl; } float cal(float length,float width) { float w; w = length * width; return w; } 33
  • 34. ‫بطباعة‬ ‫هو‬ ‫يقوم‬ ‫ثم‬ ‫أسمك‬ ‫بإدخال‬ ‫انت‬ ‫تقوم‬ ‫برنامج‬ ‫ادخلته‬ ‫الذي‬ ‫اسمك‬ ‫فيه‬ ‫يظهر‬ ‫ترحيبيه‬ ‫عبارة‬. #include <iostream> #include <string> using namespace std; int main() { string name; cout<<"Enter your name: "; cin>>name; cout<<"Hello "<<name<<endl; return 0; } 34