SlideShare a Scribd company logo
1 of 2
/*Inverted Triangle*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int w=6;
for(int g=0;g<9;g++)
{
cout<<"*";
}
cout<<"n";
for(int a=1;a<=3;a++)
{
for(int b=0;b<a;b++)
{
cout<<" ";
}
cout<<"*";
for(int c=1;c<w;c++)
{
cout<<" ";
}
cout<<"*"<<"n";
w=w-2;
}
for(int e=1;e<=1;e++)
{
for(int f=4;f>=e;f--)
{
cout<<" ";
}
cout<<"*";
}
getch();
}
/* Triangle */
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int i,j,sp,x=1;
for(i=1;i<=4;i++,x=x+2)
{
for(sp=1;sp<=4-i;sp++) cout<<" ";
for(j=1;j<=x;j++)
{
if(i>1&&i<4&&j>1&&j<x)
cout<<" ";
else
cout<<"*";
}
cout<<"n";
}
getch();
}
/*Take input of Three n.o if the are not Equal,then find the Smallest
n.o*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<"Entr 1st n.o = ";
cin>>a;
cout<<"Entr 2nd n.o = ";
cin>>b;
cout<<"Entr 3rd n.o = ";
cin>>c;
if((a<b)&&(a<c))
cout<<"Smallest n.o is = "<<a;
else if((c<a) && (c<b))
{
cout<<"Smallest n.o is = "<<c;
}
else if((b<a) && (b<c))
{
cout<<"Smallest n.o is = "<<b;
}
else
{
cout<<"All n.o are Equal";
}
getch();
}

More Related Content

What's hot (15)

C programs
C programsC programs
C programs
 
Exp3
Exp3Exp3
Exp3
 
Vcs9
Vcs9Vcs9
Vcs9
 
cosc 281 hw2
cosc 281 hw2cosc 281 hw2
cosc 281 hw2
 
Program membalik kata
Program membalik kataProgram membalik kata
Program membalik kata
 
Clock For My
Clock For MyClock For My
Clock For My
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
 
C++ TUTORIAL 7
C++ TUTORIAL 7C++ TUTORIAL 7
C++ TUTORIAL 7
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
 
Ass 1
Ass 1Ass 1
Ass 1
 
Class array
Class arrayClass array
Class array
 
Problemas de Arreglos en c++
Problemas de Arreglos en c++Problemas de Arreglos en c++
Problemas de Arreglos en c++
 
Oopsprc1e
Oopsprc1eOopsprc1e
Oopsprc1e
 

Similar to Assignement c++

C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
Junaid program assignment
Junaid program assignmentJunaid program assignment
Junaid program assignmentJunaid Ahmed
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1kkkseld
 
Layer 2221 1 Subidazbuka
Layer 2221 1 SubidazbukaLayer 2221 1 Subidazbuka
Layer 2221 1 Subidazbukawnal
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_papervandna123
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacionJeff Tu Pechito
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++Syed Umair
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxssuser3cbb4c
 
寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)均民 戴
 
Lab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceLab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceranaibrahim453
 
Project hotel on hotel management fo
Project  hotel on hotel management foProject  hotel on hotel management fo
Project hotel on hotel management foSunny Singhania
 

Similar to Assignement c++ (20)

C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Junaid program assignment
Junaid program assignmentJunaid program assignment
Junaid program assignment
 
C++ programs
C++ programsC++ programs
C++ programs
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1
 
Stl algorithm-Basic types
Stl algorithm-Basic typesStl algorithm-Basic types
Stl algorithm-Basic types
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
Layer 2221 1 Subidazbuka
Layer 2221 1 SubidazbukaLayer 2221 1 Subidazbuka
Layer 2221 1 Subidazbuka
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
C++ file
C++ fileC++ file
C++ file
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
C program
C programC program
C program
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacion
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)
 
Lab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceLab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practice
 
Project hotel on hotel management fo
Project  hotel on hotel management foProject  hotel on hotel management fo
Project hotel on hotel management fo
 

More from Syed Umair

Assignement code
Assignement codeAssignement code
Assignement codeSyed Umair
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSyed Umair
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)Syed Umair
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solvingSyed Umair
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematicsSyed Umair
 
Assignment c++12
Assignment c++12Assignment c++12
Assignment c++12Syed Umair
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematicsSyed Umair
 
Truth table a.r
Truth table a.rTruth table a.r
Truth table a.rSyed Umair
 

More from Syed Umair (20)

Assignement code
Assignement codeAssignement code
Assignement code
 
Tree 4
Tree 4Tree 4
Tree 4
 
Title page
Title pageTitle page
Title page
 
S.k
S.kS.k
S.k
 
Q.a
Q.aQ.a
Q.a
 
Prog
ProgProg
Prog
 
Perception
PerceptionPerception
Perception
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)
 
M.b
M.bM.b
M.b
 
C++ 4
C++ 4C++ 4
C++ 4
 
B.g
B.gB.g
B.g
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
 
A.i
A.iA.i
A.i
 
H m
H mH m
H m
 
Prog
ProgProg
Prog
 
Assignment c++12
Assignment c++12Assignment c++12
Assignment c++12
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
 
Truth table a.r
Truth table a.rTruth table a.r
Truth table a.r
 

Recently uploaded

Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 

Recently uploaded (20)

Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 

Assignement c++

  • 1. /*Inverted Triangle*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int w=6; for(int g=0;g<9;g++) { cout<<"*"; } cout<<"n"; for(int a=1;a<=3;a++) { for(int b=0;b<a;b++) { cout<<" "; } cout<<"*"; for(int c=1;c<w;c++) { cout<<" "; } cout<<"*"<<"n"; w=w-2; } for(int e=1;e<=1;e++) { for(int f=4;f>=e;f--) { cout<<" "; } cout<<"*"; } getch(); } /* Triangle */ #include<iostream.h> #include<conio.h> int main() { clrscr(); int i,j,sp,x=1; for(i=1;i<=4;i++,x=x+2) { for(sp=1;sp<=4-i;sp++) cout<<" "; for(j=1;j<=x;j++) { if(i>1&&i<4&&j>1&&j<x) cout<<" "; else
  • 2. cout<<"*"; } cout<<"n"; } getch(); } /*Take input of Three n.o if the are not Equal,then find the Smallest n.o*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int a,b,c; cout<<"Entr 1st n.o = "; cin>>a; cout<<"Entr 2nd n.o = "; cin>>b; cout<<"Entr 3rd n.o = "; cin>>c; if((a<b)&&(a<c)) cout<<"Smallest n.o is = "<<a; else if((c<a) && (c<b)) { cout<<"Smallest n.o is = "<<c; } else if((b<a) && (b<c)) { cout<<"Smallest n.o is = "<<b; } else { cout<<"All n.o are Equal"; } getch(); }