SlideShare a Scribd company logo
Programming &ProblemSolving
1
/*Write a program that input two number interchange the value of and then display them
without using third variable.*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<"Entr 1st num : ";
cin>>a;
cout<<"Entr 2nd num : ";
cin>>b;
cout<<"Value Befor Swapping:"<<endl;
cout<<"1st num="<<a<<endl;
cout<<"2nd num="<<b<<endl;
a=a+b;
b=a-b;
a=a-b;
cout<<"Value After Swapping:"<<endl;
cout<<"1st num="<<a<<endl;
cout<<"2nd num="<<b<<endl;
getch();
}
Out Put
Programming &ProblemSolving
2
/*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";}
Programming &ProblemSolving
3
getch();
}
Out Put
/*Take input of two n.o if 1st n.o is greater than 2nd,display the division
as follow i.e. 1st=16 2nd=5 Ans=5*3+1=16*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n1,n2;
cout<<"Entr 1st no. = ";
cin>>n1;
cout<<"Entr 2nd no. = " ;
cin>>n2;
if(n2>n1)
{
cout<<"invalide input";
}
else
cout<<n2<<" * "<<n1/n2<<" + "<<n1%n2<<" = "<<n1<<"n";
getch();
Programming &ProblemSolving
4
}
Out Put
/*Show out
*****
*****
***** */
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=5;j++)
{
cout<<"*";
}
cout<<"n";
}
getch();
}
Programming &ProblemSolving
5
Out Put
/*Take input a n.o and find if it is divisible by 10 or not*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a;
cout<<"Entr any number = ";
cin>>a;
if(a%10==0)
{
cout<<"it is Divisible by 10";
}
else
{
cout<<"it is not Divisible by 10";
}
getch();
Programming &ProblemSolving
6
}
Out Put
/*entr 10 student age and show average age*/
#include <iostream.h>
#include<conio.h>
void main()
{
clrscr();
float age1,age2,age3,age4,age5,age6,age7,age8,age9,age10;
float TotalAge;
float AverageAge;
cout <<" Please Enter The Age Of Student 1:" ;
cin >> age1;
cout <<" Please Enter The Age Of Student 2:" ;
cin >> age2;
cout <<" Please Enter The Age Of Student 3:" ;
cin >> age3;
cout <<" Please Enter The Age Of Student 4:" ;
cin >> age4;
cout <<" Please Enter The Age Of Student 5:" ;
cin >> age5;
cout <<" Please Enter The Age Of Student 6:" ;
Programming &ProblemSolving
7
cin >> age6;
cout <<" Please Enter The Age Of Student 7:" ;
cin >> age7;
cout <<" Please Enter The Age Of Student 8:" ;
cin >> age8;
cout <<" Please Enter The Age Of Student 9:" ;
cin >> age9;
cout <<" Please Enter The Age Of Student 10:" ;
cin >> age10;
TotalAge=age1+age2+age3+age4+age5+age6+age7+age8+age9+age10;
AverageAge=TotalAge/10 ;
cout << " Average Age Of Class Is : " << AverageAge ;
getch();
}
Out Put
/*Show 1st 8 FIBONACCI Number */
#include<iostream.h>
#include<conio.h>
void main()
Programming &ProblemSolving
8
{
clrscr();
long int a=21,b=0,c=1,sum;
while(b<a)
{
cout<<c<<" ";
sum=b+c;
b=c;
c=sum;
}
getch();
}
Out Put
/* Show out
*
**
***
**** */
#include<iostream.h>
#include<conio.h>
void main()
Programming &ProblemSolving
9
{
clrscr();
int i,j,sp;
for(i=1;i<=4;i++){
for(sp=1;sp<=4-i;sp++)
{
cout<<" ";
}
for(j=1;j<=i;j++)
{
cout<<"*";}
cout<<"n";
}
getch();
}
Out Put
/*Triangle */
#include<iostream.h>
#include<conio.h>
Programming &ProblemSolving
10
void main() //if(i==1&&i==4&&j==1&&j==x)
{
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();
}
Out Put
Programming &ProblemSolving
11
/*SUM OF 1ST 6TH PRIME NUMBER*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,sum=0,flag=1,x;
for(i=1,x=0;x<=5;i++)
{
for(j=2;j<=i/2;j++)
{
if(i%j==0)
{
flag=0;
break;
}
}
if(flag)
{
x++;
sum+=i;
cout<<i<<" + ";
}
Programming &ProblemSolving
12
else
{
flag=1;
}
}
cout<<"bb = "<<sum;
getch();}
Out Put
/*Enter The Amount Of The Bill And Discount At The Rate Of 10% */
#include <iostream.h>
#include<conio.h>
void main ()
{
clrscr();
double amount,discount,netpayable;
cout << " Please Enter The Amount Of The Bill ";
cin >> amount;
if(amount>5000)
{
discount = amount*(15.0/100);
netpayable = amount-discount;
cout <<" The Discount At The Rate Of 15 % is Rupees " << discount << endl;
Programming &ProblemSolving
13
cout << " The Payable Amount is Rupees " << netpayable;
}
else
{
discount = amount*(10.0/100);
netpayable = amount-discount;
cout <<" The Discount At The Rate Of 10 % is Rupees " << discount << endl;
cout << " The Payable Amount is Rupees " << netpayable;
}
getch();
}
Out Put
/*Show out
****
***
**
* */
#include<iostream.h>
#include<conio.h>
void main()
{
Programming &ProblemSolving
14
clrscr();
int i,j;
for(i=1;i<=4;i++)
{
for(j=i;j<=4;j++)
{
cout<<"*";
}
cout<<"n";
}
getch();
}
Out Put
/*Write a program that generates the following output using a single nested loop
$
##
$$$
#### */
#include<iostream.h>
#include<conio.h>
Programming &ProblemSolving
15
void main()
{
clrscr();
int i,j;
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
if(i%2==0)
cout<<"#";
else
cout<<"$";
cout<<"n";
}
getch();
}
Out Put

More Related Content

What's hot (20)

PPTX
งานนำเสนอ อาจารย์ลาวัลย์
น้ำตาล มาแล้วจ้า
 
PPTX
C- Programs - Harsh
Harsh Sharma
 
DOCX
Pratik Bakane C++
pratikbakane
 
DOCX
Pratik Bakane C++
pratikbakane
 
PDF
Stl algorithm-Basic types
mohamed sikander
 
DOCX
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp
 
DOCX
Assignment#1
NA000000
 
PDF
C++ programs
Mukund Gandrakota
 
DOCX
Pratik Bakane C++
pratikbakane
 
DOCX
c plus plus programsSlide
harman kaur
 
PDF
C++ Programming - 3rd Study
Chris Ohk
 
DOCX
Tugas Program C++
Reynes E. Tekay
 
PPTX
Function basics
mohamed sikander
 
PPTX
Lecture 3
Mohammed Khan
 
DOCX
Program Kasir c++(case ROti88)
Achmad Sidik
 
PPTX
MFC Rect2
Razvan Raducanu, PhD
 
DOCX
C++ assignment
Zohaib Ahmed
 
PDF
Oopsprc1e
Ankit Dubey
 
DOCX
basic programs in C++
Arun Nair
 
งานนำเสนอ อาจารย์ลาวัลย์
น้ำตาล มาแล้วจ้า
 
C- Programs - Harsh
Harsh Sharma
 
Pratik Bakane C++
pratikbakane
 
Pratik Bakane C++
pratikbakane
 
Stl algorithm-Basic types
mohamed sikander
 
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp
 
Assignment#1
NA000000
 
C++ programs
Mukund Gandrakota
 
Pratik Bakane C++
pratikbakane
 
c plus plus programsSlide
harman kaur
 
C++ Programming - 3rd Study
Chris Ohk
 
Tugas Program C++
Reynes E. Tekay
 
Function basics
mohamed sikander
 
Lecture 3
Mohammed Khan
 
Program Kasir c++(case ROti88)
Achmad Sidik
 
C++ assignment
Zohaib Ahmed
 
Oopsprc1e
Ankit Dubey
 
basic programs in C++
Arun Nair
 

Similar to Assignement of programming & problem solving (20)

DOCX
Assignement of programming & problem solving u.s ass.(1)
Syed Umair
 
PPTX
Assignement of c++
Syed Umair
 
DOC
CBSE Class XII Comp sc practical file
Pranav Ghildiyal
 
PPTX
oops practical file.pptx IT IS A PRACTICAL FILE
ritikghw
 
PDF
C++ practical
Rahul juneja
 
PPTX
Example Programs of CPP programs ch 1.pptx
DrVikasMahor
 
PDF
You will be implementing the following functions. You may modify the.pdf
malavshah9013
 
DOC
Practical Class 12th (c++programs+sql queries and output)
Aman Deep
 
DOC
Practical Class 12th (c++programs+sql queries and output)
Aman Deep
 
PDF
C++ TUTORIAL 2
Farhan Ab Rahman
 
PDF
C++ TUTORIAL 3
Farhan Ab Rahman
 
PDF
C++ TUTORIAL 4
Farhan Ab Rahman
 
PDF
Java p1
Frederick Martinez
 
PDF
Computer science-2010-cbse-question-paper
Deepak Singh
 
PDF
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
aassecuritysystem
 
DOCX
Oops practical file
Ankit Dixit
 
PDF
Programming in C Lab
Neil Mathew
 
DOCX
C++ file
Mukund Trivedi
 
DOCX
#include fstream#include iostream#include cstdlib#includ.docx
ajoy21
 
PDF
C++ TUTORIAL 1
Farhan Ab Rahman
 
Assignement of programming & problem solving u.s ass.(1)
Syed Umair
 
Assignement of c++
Syed Umair
 
CBSE Class XII Comp sc practical file
Pranav Ghildiyal
 
oops practical file.pptx IT IS A PRACTICAL FILE
ritikghw
 
C++ practical
Rahul juneja
 
Example Programs of CPP programs ch 1.pptx
DrVikasMahor
 
You will be implementing the following functions. You may modify the.pdf
malavshah9013
 
Practical Class 12th (c++programs+sql queries and output)
Aman Deep
 
Practical Class 12th (c++programs+sql queries and output)
Aman Deep
 
C++ TUTORIAL 2
Farhan Ab Rahman
 
C++ TUTORIAL 3
Farhan Ab Rahman
 
C++ TUTORIAL 4
Farhan Ab Rahman
 
Computer science-2010-cbse-question-paper
Deepak Singh
 
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
aassecuritysystem
 
Oops practical file
Ankit Dixit
 
Programming in C Lab
Neil Mathew
 
C++ file
Mukund Trivedi
 
#include fstream#include iostream#include cstdlib#includ.docx
ajoy21
 
C++ TUTORIAL 1
Farhan Ab Rahman
 
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
C++ 4
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
 
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
 
C++ 4
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
 
Ad

Recently uploaded (20)

PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PPTX
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PPTX
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPT
digestive system for Pharm d I year HAP
rekhapositivity
 
PPTX
How to Define Translation to Custom Module And Add a new language in Odoo 18
Celine George
 
PDF
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
PPTX
Presentation: Climate Citizenship Digital Education
Karl Donert
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
digestive system for Pharm d I year HAP
rekhapositivity
 
How to Define Translation to Custom Module And Add a new language in Odoo 18
Celine George
 
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
Presentation: Climate Citizenship Digital Education
Karl Donert
 

Assignement of programming & problem solving

  • 1. Programming &ProblemSolving 1 /*Write a program that input two number interchange the value of and then display them without using third variable.*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int a,b; cout<<"Entr 1st num : "; cin>>a; cout<<"Entr 2nd num : "; cin>>b; cout<<"Value Befor Swapping:"<<endl; cout<<"1st num="<<a<<endl; cout<<"2nd num="<<b<<endl; a=a+b; b=a-b; a=a-b; cout<<"Value After Swapping:"<<endl; cout<<"1st num="<<a<<endl; cout<<"2nd num="<<b<<endl; getch(); } Out Put
  • 2. Programming &ProblemSolving 2 /*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";}
  • 3. Programming &ProblemSolving 3 getch(); } Out Put /*Take input of two n.o if 1st n.o is greater than 2nd,display the division as follow i.e. 1st=16 2nd=5 Ans=5*3+1=16*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int n1,n2; cout<<"Entr 1st no. = "; cin>>n1; cout<<"Entr 2nd no. = " ; cin>>n2; if(n2>n1) { cout<<"invalide input"; } else cout<<n2<<" * "<<n1/n2<<" + "<<n1%n2<<" = "<<n1<<"n"; getch();
  • 4. Programming &ProblemSolving 4 } Out Put /*Show out ***** ***** ***** */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int i,j; for(i=1;i<=3;i++) { for(j=1;j<=5;j++) { cout<<"*"; } cout<<"n"; } getch(); }
  • 5. Programming &ProblemSolving 5 Out Put /*Take input a n.o and find if it is divisible by 10 or not*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int a; cout<<"Entr any number = "; cin>>a; if(a%10==0) { cout<<"it is Divisible by 10"; } else { cout<<"it is not Divisible by 10"; } getch();
  • 6. Programming &ProblemSolving 6 } Out Put /*entr 10 student age and show average age*/ #include <iostream.h> #include<conio.h> void main() { clrscr(); float age1,age2,age3,age4,age5,age6,age7,age8,age9,age10; float TotalAge; float AverageAge; cout <<" Please Enter The Age Of Student 1:" ; cin >> age1; cout <<" Please Enter The Age Of Student 2:" ; cin >> age2; cout <<" Please Enter The Age Of Student 3:" ; cin >> age3; cout <<" Please Enter The Age Of Student 4:" ; cin >> age4; cout <<" Please Enter The Age Of Student 5:" ; cin >> age5; cout <<" Please Enter The Age Of Student 6:" ;
  • 7. Programming &ProblemSolving 7 cin >> age6; cout <<" Please Enter The Age Of Student 7:" ; cin >> age7; cout <<" Please Enter The Age Of Student 8:" ; cin >> age8; cout <<" Please Enter The Age Of Student 9:" ; cin >> age9; cout <<" Please Enter The Age Of Student 10:" ; cin >> age10; TotalAge=age1+age2+age3+age4+age5+age6+age7+age8+age9+age10; AverageAge=TotalAge/10 ; cout << " Average Age Of Class Is : " << AverageAge ; getch(); } Out Put /*Show 1st 8 FIBONACCI Number */ #include<iostream.h> #include<conio.h> void main()
  • 8. Programming &ProblemSolving 8 { clrscr(); long int a=21,b=0,c=1,sum; while(b<a) { cout<<c<<" "; sum=b+c; b=c; c=sum; } getch(); } Out Put /* Show out * ** *** **** */ #include<iostream.h> #include<conio.h> void main()
  • 9. Programming &ProblemSolving 9 { clrscr(); int i,j,sp; for(i=1;i<=4;i++){ for(sp=1;sp<=4-i;sp++) { cout<<" "; } for(j=1;j<=i;j++) { cout<<"*";} cout<<"n"; } getch(); } Out Put /*Triangle */ #include<iostream.h> #include<conio.h>
  • 10. Programming &ProblemSolving 10 void main() //if(i==1&&i==4&&j==1&&j==x) { 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(); } Out Put
  • 11. Programming &ProblemSolving 11 /*SUM OF 1ST 6TH PRIME NUMBER*/ #include<iostream.h> #include<conio.h> void main() { clrscr(); int i,j,sum=0,flag=1,x; for(i=1,x=0;x<=5;i++) { for(j=2;j<=i/2;j++) { if(i%j==0) { flag=0; break; } } if(flag) { x++; sum+=i; cout<<i<<" + "; }
  • 12. Programming &ProblemSolving 12 else { flag=1; } } cout<<"bb = "<<sum; getch();} Out Put /*Enter The Amount Of The Bill And Discount At The Rate Of 10% */ #include <iostream.h> #include<conio.h> void main () { clrscr(); double amount,discount,netpayable; cout << " Please Enter The Amount Of The Bill "; cin >> amount; if(amount>5000) { discount = amount*(15.0/100); netpayable = amount-discount; cout <<" The Discount At The Rate Of 15 % is Rupees " << discount << endl;
  • 13. Programming &ProblemSolving 13 cout << " The Payable Amount is Rupees " << netpayable; } else { discount = amount*(10.0/100); netpayable = amount-discount; cout <<" The Discount At The Rate Of 10 % is Rupees " << discount << endl; cout << " The Payable Amount is Rupees " << netpayable; } getch(); } Out Put /*Show out **** *** ** * */ #include<iostream.h> #include<conio.h> void main() {
  • 14. Programming &ProblemSolving 14 clrscr(); int i,j; for(i=1;i<=4;i++) { for(j=i;j<=4;j++) { cout<<"*"; } cout<<"n"; } getch(); } Out Put /*Write a program that generates the following output using a single nested loop $ ## $$$ #### */ #include<iostream.h> #include<conio.h>
  • 15. Programming &ProblemSolving 15 void main() { clrscr(); int i,j; for(i=1;i<=4;i++) { for(j=1;j<=i;j++) if(i%2==0) cout<<"#"; else cout<<"$"; cout<<"n"; } getch(); } Out Put