SlideShare a Scribd company logo
1
Programming& ProblemSolving
/*Write a Program that takes input in an array of any size and reverses it.*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int arr[5];
for(int i=0;i<5;i++)
{
cout<<"entrnumber";
cin>>arr[i];
}
cout<<"inactual order.n";
for(i=0;i<5;i++)
cout<<arr[i]<<"n";
cout<<"inreverse order.n";
for(i=5;i>=0;i--)
cout<<arr[i]<<"n";
getch();
}
OUTPUT
/*Write a Program that displays the following series using recursion without loop.
2 4 6 8 10*/
2
Programming& ProblemSolving
#include<conio.h>
#include<iostream.h>
void f(int n)
{
cout<<n<<" ";
if(n<10) f(n+=2);
}
int main()
{
f(2);
getch();
}
OUTPUT
/*Write a program that input in an array of any size from the user stor them in an array and
display the sum and product of these values*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int arr[10],i,s=0,p=2;
for(i=0;i<10;i++)
{
cout<<"entr values = ";
cin>>arr[i];
s=s+arr[i];
}
p=p*s;
cout<<"sum is = "<<s<<"n";
cout<<"product is = "<<p<<"n";
getch();
}
OUTPUT

More Related Content

What's hot (20)

PDF
C++ Programming - 3rd Study
Chris Ohk
 
DOCX
Check the output of the following code then recode it to eliminate fu
licservernoida
 
PDF
Functions
Kamal Acharya
 
DOCX
Pratik Bakane C++
pratikbakane
 
PPTX
C- Programs - Harsh
Harsh Sharma
 
PDF
Operator overloading
mohamed sikander
 
DOCX
C++ 4
Syed Umair
 
DOCX
Pratik Bakane C++
pratikbakane
 
PDF
Stl algorithm-Basic types
mohamed sikander
 
DOCX
Pratik Bakane C++
pratikbakane
 
DOCX
Basic Programs of C++
Bharat Kalia
 
DOCX
c plus plus programsSlide
harman kaur
 
DOCX
Pratik Bakane C++
pratikbakane
 
DOC
VLSI Sequential Circuits II
Gouthaman V
 
DOCX
Lab loop
Manode Boonpeng
 
DOCX
C++ file
simarsimmygrewal
 
PPT
Loops (1)
esmail said
 
DOCX
Reloj en java
cathe26
 
DOCX
C++ assignment
Zohaib Ahmed
 
C++ Programming - 3rd Study
Chris Ohk
 
Check the output of the following code then recode it to eliminate fu
licservernoida
 
Functions
Kamal Acharya
 
Pratik Bakane C++
pratikbakane
 
C- Programs - Harsh
Harsh Sharma
 
Operator overloading
mohamed sikander
 
C++ 4
Syed Umair
 
Pratik Bakane C++
pratikbakane
 
Stl algorithm-Basic types
mohamed sikander
 
Pratik Bakane C++
pratikbakane
 
Basic Programs of C++
Bharat Kalia
 
c plus plus programsSlide
harman kaur
 
Pratik Bakane C++
pratikbakane
 
VLSI Sequential Circuits II
Gouthaman V
 
Lab loop
Manode Boonpeng
 
Loops (1)
esmail said
 
Reloj en java
cathe26
 
C++ assignment
Zohaib Ahmed
 

Similar to Assignement of programming & problem solving(3)a.z (20)

PDF
54602399 c-examples-51-to-108-programe-ee01083101
premrings
 
PPTX
Computational Physics Cpp Portiiion.pptx
khanzasad009
 
DOCX
C++ file
Mukund Trivedi
 
DOCX
C++ file
Mukund Trivedi
 
PPTX
Oop object oriented programing topics
(•̮̮̃•̃) Prince Do Not Work
 
PPTX
Computational PhysicsssComputational Physics.pptx
khanzasad009
 
PDF
Modify this code to use multiple threads with the same data1.Modif.pdf
mallik3000
 
PPT
Practical basics on c++
Marco Izzotti
 
PDF
C++ L03-Control Structure
Mohammad Shaker
 
DOCX
Bijender (1)
Ankush Kumar
 
PPT
Lecture05
elearning_portal
 
PPT
FP 201 - Unit 3 Part 2
rohassanie
 
PPT
ch5_additional.ppt
LokeshK66
 
PPTX
Managing console
Shiva Saxena
 
PDF
Solved Practice Problems For the C++ Exams
MuhammadTalha436
 
PDF
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
kinan keshkeh
 
PDF
Programming Fundamentals presentation slide
mibrahim020205
 
PDF
C++ TUTORIAL 3
Farhan Ab Rahman
 
PPTX
OOPS PROGRAM for the clarity of functions in c++
soniasharmafdp
 
54602399 c-examples-51-to-108-programe-ee01083101
premrings
 
Computational Physics Cpp Portiiion.pptx
khanzasad009
 
C++ file
Mukund Trivedi
 
C++ file
Mukund Trivedi
 
Oop object oriented programing topics
(•̮̮̃•̃) Prince Do Not Work
 
Computational PhysicsssComputational Physics.pptx
khanzasad009
 
Modify this code to use multiple threads with the same data1.Modif.pdf
mallik3000
 
Practical basics on c++
Marco Izzotti
 
C++ L03-Control Structure
Mohammad Shaker
 
Bijender (1)
Ankush Kumar
 
Lecture05
elearning_portal
 
FP 201 - Unit 3 Part 2
rohassanie
 
ch5_additional.ppt
LokeshK66
 
Managing console
Shiva Saxena
 
Solved Practice Problems For the C++ Exams
MuhammadTalha436
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
kinan keshkeh
 
Programming Fundamentals presentation slide
mibrahim020205
 
C++ TUTORIAL 3
Farhan Ab Rahman
 
OOPS PROGRAM for the clarity of functions in c++
soniasharmafdp
 
Ad

More from Syed Umair (20)

TXT
Assignement code
Syed Umair
 
DOCX
Tree 4
Syed Umair
 
DOCX
Title page
Syed Umair
 
DOCX
S.k
Syed Umair
 
DOCX
Q.a
Syed Umair
 
DOCX
Prog
Syed Umair
 
DOCX
Perception
Syed Umair
 
DOCX
New microsoft office word document
Syed Umair
 
DOCX
New microsoft office word document (2)
Syed Umair
 
DOCX
M.b
Syed Umair
 
DOCX
B.g
Syed Umair
 
DOCX
Assignement of discrete mathematics
Syed Umair
 
DOCX
A.i
Syed Umair
 
DOCX
H m
Syed Umair
 
DOCX
Prog
Syed Umair
 
DOCX
Assignment c++12
Syed Umair
 
DOCX
Assignement of discrete mathematics
Syed Umair
 
DOCX
Assignement c++
Syed Umair
 
DOCX
Truth table a.r
Syed Umair
 
DOCX
Static keyword u.s ass.(2)
Syed Umair
 
Assignement code
Syed Umair
 
Tree 4
Syed Umair
 
Title page
Syed Umair
 
Perception
Syed Umair
 
New microsoft office word document
Syed Umair
 
New microsoft office word document (2)
Syed Umair
 
Assignement of discrete mathematics
Syed Umair
 
Assignment c++12
Syed Umair
 
Assignement of discrete mathematics
Syed Umair
 
Assignement c++
Syed Umair
 
Truth table a.r
Syed Umair
 
Static keyword u.s ass.(2)
Syed Umair
 
Ad

Recently uploaded (20)

PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPTX
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPT
digestive system for Pharm d I year HAP
rekhapositivity
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PPTX
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
digestive system for Pharm d I year HAP
rekhapositivity
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 

Assignement of programming & problem solving(3)a.z

  • 1. 1 Programming& ProblemSolving /*Write a Program that takes input in an array of any size and reverses it.*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int arr[5]; for(int i=0;i<5;i++) { cout<<"entrnumber"; cin>>arr[i]; } cout<<"inactual order.n"; for(i=0;i<5;i++) cout<<arr[i]<<"n"; cout<<"inreverse order.n"; for(i=5;i>=0;i--) cout<<arr[i]<<"n"; getch(); } OUTPUT /*Write a Program that displays the following series using recursion without loop. 2 4 6 8 10*/
  • 2. 2 Programming& ProblemSolving #include<conio.h> #include<iostream.h> void f(int n) { cout<<n<<" "; if(n<10) f(n+=2); } int main() { f(2); getch(); } OUTPUT /*Write a program that input in an array of any size from the user stor them in an array and display the sum and product of these values*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int arr[10],i,s=0,p=2; for(i=0;i<10;i++) { cout<<"entr values = "; cin>>arr[i]; s=s+arr[i]; } p=p*s; cout<<"sum is = "<<s<<"n"; cout<<"product is = "<<p<<"n"; getch(); } OUTPUT