SlideShare a Scribd company logo
/******************Program 1 ***************
#include<iostream.h>
void display(char *s)
{
for(int x=0;s[x]>0;x++)
{
for(int y=0;y<=x;y++)
cout<<s[y];
cout<<endl;
}
}
void main()
{
char *t="LAND";
display(t);
}
*****************Program 2 ***************
#include<iostream.h>
int &max (int &x,int &y)
{
if(x>y)
return (x);
else
return (y);
}
void main()
{
clrscr();
int A=10,B=13;
max(A,B)=-1;
cout<<"A= "<<A<<"B= "<<B<<endl;
max(B,A)=7;
cout<<"A= "<<A<<"B= "<<B<<endl;
getch();
}
*****************Program 3 ***************
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
char string[]="Pointers and strings";
cout<<*(&string[2])<<endl;
cout.write(string+5,15).put('n');
cout<<*(string+3)<<'n';
getch();
return 0;
}
/* // *****************Program 4 ***************
#include<iostream.h>
#include<conio.h>
int a=10;
void main()
{
void demo(int &,int,int*);
int a=20,b=5;
demo(::a,a,&b);
cout<<::a<<a<<b<<endl;
}
void demo(int &x,int y,int *z)
{
a+=x;
y*=a;
*z=a+y;
cout<<x<<y<<*z<<endl;
}
//*****************Program 5 ***************
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{
char *S="ObjeCT";
int L=strlen(S);
for(int C=0;C<L;C++)
if(islower(S[C]))
S[C]=toupper(S[C]);
else
if(C%2==0)
S[C]='E';
else
S[C]=tolower(S[C]);
cout<<"New message :"<<S;
getch();
}
//*****************Program 6 ***************
#include<iostream.h>
void Execute(int &x,int y=200)
{
int temp=x+y;
x+=temp;
if(y!=200)
cout<<temp<<" "<<x<<" "<<y<<endl;
}
void main()
{
int a=50,b=20;
Execute(b);
cout<<a<<" "<<b<<endl;
Execute(a,b);
cout<<a<<" "<<b<<endl;
}
//*****************Program 7 ***************
#include<iostream.h>
void print(char *p)
{
p="Pass";
cout<<"n Value is "<<p<<endl;
}
void main()
{
char *q="Best Of luck";
print(q);
cout<<"n New value is "<<q;
}
//*****************Program 8 ***************
#include<iostream.h>
#include<conio.h>
/*#include<string.h>
#include<ctype.h>
void main()
{
char *s="GOODLUCK";
for(int x=strlen(s)-1;x>0;x--)
{
for(int y=0;y<=x;y++) cout<<s[y];
cout<<endl;
}
}
//*****************Program 9 ***************
#include<iostream.h>
int a=3;
void demo(int x, int y,int &z)
{
a+=x+y;
z=a+y;
y+=x;
cout<<x<<" "<<y<<" "<<z<<endl;
}
void main()
{
int a=2,b=5;
demo(::a,a,b);
cout<<::a<<" " <<a<<" "<<b<<endl;
demo(::a,a,b);
}
//*****************Program 10 ***************
#include<iostream.h>
int max(int &x,int &y,int &z)
{
if(x>y &&y>z)
{
y++;
z++;
return x;
}
else
if(y>x)
return y;
else
return z;
}
void main()
{
int a=10,b=13,c=8;
a=max(a,b,c);
cout<<a<<b<<c<<endl;
b=max(a,b,c);
cout<<++a<<++b<<++c<<endl;
}
//*****************Program 11 ***************
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{
clrscr();
int a=32,*X=&a;
char ch=65,&cho=ch;
cho+=a;
*X+=ch;
cout<<a<<','<<ch<<endl;
}
//*****************Program 12 ***************
#include<iostream.h>
struct point
{
int x,y;
};
void show(point p)
{
cout<<p.x<<';'<<p.y<<endl;
}
void main()
{
point U={0,10},V,W;
V=U;
V.x+=0;
W=V;
U.y+=10;
U.x+=5;
W.x-=5;
show(U);
show(V);
show(W);
}
//************** Program 13 ***************
#include<iostream.h>
void main()
{
int x[]={10,20,30,40,50};
int *p,**q;
int *t;
p=x;
t=x+1;
q=&t;
cout<<*p<<','<<**q<<','<<*t++;
}
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
class state
{
char *statename;
int size;
public:
state()
{
size=0;
statename=new char[size+1];
}
void display() { cout<<statename<<endl; }
state(char *s)
{
size=strlen(s);
statename=new char[size+1];
strcpy(statename,s);
}
void replace(state &a, state &b)
{ size=a.size+b.size;
delete statename;
statename=new char[size+1];
strcpy(statename,a.statename);
strcat(statename,b.statename);
}
};
void main()
{
char *temp="Delhi";
state state1(temp),state2("mumbai"),state3("Nagpur"),S1,S2;
S1.replace(state1,state2);
S2.replace(S1,state3);
S1.display();
S2.display();
}
*/
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{
clrscr();
long NUM=1234543;
int f=0,s=0;
do{
int rem=NUM%10;
if(rem%2==0)
f+=rem;
else
s+=rem;
NUM/=10;
}while(NUM>0);
cout<<f-s;
}
/************** OUTPUT Program 1 ***************
L
LA
LAN
LAND
************** OUTPUT Program 2 ***************
A= 10B= -1
A= 7B= -1
************** OUTPUT Program 3 ***************
i
ers and strings
n
************** OUTPUT Program 4 ***************
20400420
2020420
************** OUTPUT Program 5 ***************
New message :EBJEEt
************** OUTPUT Program 6 ***************
50 240
290 340 240
340 240
22
************** OUTPUT Program 7 ***************
Value is Pass
New value is Best Of luck
************** OUTPUT Program 8 ***************
GOODLUCK
GOODLUC
GOODLU
GOODL
GOOD
GOO
GO
************** OUTPUT Program 9 ***************
3 5 10
8 2 10
8 10 20
************** OUTPUT Program 10 ***************
13138
1499
************** OUTPUT Program 11 ***************
129,a
************** OUTPUT Program 12 ***************
5;20
0;10
-5;10
************** OUTPUT Program 13 ***************
10,30,20
************** OUTPUT Program 14 ***************
Delhimumbai
DelhimumbaiNagpur
************** OUTPUT Program 15 ***************
-2
*/

More Related Content

PDF
C++ programs
DOCX
Pratik Bakane C++
DOCX
Basic Programs of C++
DOCX
Pratik Bakane C++
DOCX
Pratik Bakane C++
PDF
C++ TUTORIAL 7
PDF
20180310 functional programming
DOCX
Binomial heap
C++ programs
Pratik Bakane C++
Basic Programs of C++
Pratik Bakane C++
Pratik Bakane C++
C++ TUTORIAL 7
20180310 functional programming
Binomial heap

What's hot (20)

PDF
20181020 advanced higher-order function
PDF
2016 gunma.web games-and-asm.js
DOCX
C++ file
PDF
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
PDF
20151224-games
PDF
20180721 code defragment
PDF
Mozilla とブラウザゲーム
PDF
Shapes and calculate (area and contour) / C++ oop concept
DOCX
Oop lab report
DOCX
Opp compile
PDF
Cycle.js: Functional and Reactive
DOCX
Jarmo van de Seijp Shadbox ERC223
PDF
Shapes and calculate (area and contour) / C++ oop concept
KEY
Sbaw090519
PDF
Elm: give it a try
PDF
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
PDF
Go a crash course
DOC
VLSI Sequential Circuits II
20181020 advanced higher-order function
2016 gunma.web games-and-asm.js
C++ file
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
20151224-games
20180721 code defragment
Mozilla とブラウザゲーム
Shapes and calculate (area and contour) / C++ oop concept
Oop lab report
Opp compile
Cycle.js: Functional and Reactive
Jarmo van de Seijp Shadbox ERC223
Shapes and calculate (area and contour) / C++ oop concept
Sbaw090519
Elm: give it a try
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
Go a crash course
VLSI Sequential Circuits II
Ad

Similar to Program(Output) (20)

DOCX
Assignement c++
TXT
c++ project on restaurant billing
PDF
C++ Programming - 2nd Study
PDF
2014 computer science_question_paper
DOC
Project hotel on hotel management fo
PDF
C++ L05-Functions
PPT
DOCX
Assignement of programming & problem solving u.s ass.(1)
PDF
oodp elab.pdf
PDF
C++ normal assignments by maharshi_jd.pdf
PPT
KEY
Blocks+gcd入門
PDF
Program of sorting using shell sort #include stdio.h #de.pdf
PDF
operating system ubuntu,linux,MacProgram will work only if you g.pdf
PPTX
Assignement of c++
PDF
C# Assignmet Help
PDF
寫程式?那些老師沒教的事 (Git 部分節錄)
PDF
C++ Programming - 4th Study
PDF
Pemrograman visual
PDF
Implementing Software Machines in Go and C
Assignement c++
c++ project on restaurant billing
C++ Programming - 2nd Study
2014 computer science_question_paper
Project hotel on hotel management fo
C++ L05-Functions
Assignement of programming & problem solving u.s ass.(1)
oodp elab.pdf
C++ normal assignments by maharshi_jd.pdf
Blocks+gcd入門
Program of sorting using shell sort #include stdio.h #de.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdf
Assignement of c++
C# Assignmet Help
寫程式?那些老師沒教的事 (Git 部分節錄)
C++ Programming - 4th Study
Pemrograman visual
Implementing Software Machines in Go and C
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Basic Mud Logging Guide for educational purpose
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Classroom Observation Tools for Teachers
PPTX
Institutional Correction lecture only . . .
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
master seminar digital applications in india
O7-L3 Supply Chain Operations - ICLT Program
VCE English Exam - Section C Student Revision Booklet
O5-L3 Freight Transport Ops (International) V1.pdf
human mycosis Human fungal infections are called human mycosis..pptx
PPH.pptx obstetrics and gynecology in nursing
Renaissance Architecture: A Journey from Faith to Humanism
Basic Mud Logging Guide for educational purpose
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Classroom Observation Tools for Teachers
Institutional Correction lecture only . . .
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Computing-Curriculum for Schools in Ghana
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
TR - Agricultural Crops Production NC III.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Module 4: Burden of Disease Tutorial Slides S2 2025
2.FourierTransform-ShortQuestionswithAnswers.pdf

Program(Output)

  • 1. /******************Program 1 *************** #include<iostream.h> void display(char *s) { for(int x=0;s[x]>0;x++) { for(int y=0;y<=x;y++) cout<<s[y]; cout<<endl; } } void main() { char *t="LAND"; display(t); } *****************Program 2 *************** #include<iostream.h> int &max (int &x,int &y) { if(x>y) return (x); else return (y); } void main()
  • 2. { clrscr(); int A=10,B=13; max(A,B)=-1; cout<<"A= "<<A<<"B= "<<B<<endl; max(B,A)=7; cout<<"A= "<<A<<"B= "<<B<<endl; getch(); } *****************Program 3 *************** #include<iostream.h> #include<conio.h> int main() { clrscr(); char string[]="Pointers and strings"; cout<<*(&string[2])<<endl; cout.write(string+5,15).put('n'); cout<<*(string+3)<<'n'; getch(); return 0; } /* // *****************Program 4 *************** #include<iostream.h> #include<conio.h> int a=10; void main()
  • 3. { void demo(int &,int,int*); int a=20,b=5; demo(::a,a,&b); cout<<::a<<a<<b<<endl; } void demo(int &x,int y,int *z) { a+=x; y*=a; *z=a+y; cout<<x<<y<<*z<<endl; } //*****************Program 5 *************** #include<iostream.h> #include<conio.h> #include<string.h> #include<ctype.h> void main() { char *S="ObjeCT"; int L=strlen(S); for(int C=0;C<L;C++) if(islower(S[C])) S[C]=toupper(S[C]);
  • 4. else if(C%2==0) S[C]='E'; else S[C]=tolower(S[C]); cout<<"New message :"<<S; getch(); } //*****************Program 6 *************** #include<iostream.h> void Execute(int &x,int y=200) { int temp=x+y; x+=temp; if(y!=200) cout<<temp<<" "<<x<<" "<<y<<endl; } void main() { int a=50,b=20; Execute(b); cout<<a<<" "<<b<<endl; Execute(a,b); cout<<a<<" "<<b<<endl; }
  • 5. //*****************Program 7 *************** #include<iostream.h> void print(char *p) { p="Pass"; cout<<"n Value is "<<p<<endl; } void main() { char *q="Best Of luck"; print(q); cout<<"n New value is "<<q; } //*****************Program 8 *************** #include<iostream.h> #include<conio.h> /*#include<string.h> #include<ctype.h> void main() { char *s="GOODLUCK"; for(int x=strlen(s)-1;x>0;x--) { for(int y=0;y<=x;y++) cout<<s[y]; cout<<endl;
  • 6. } } //*****************Program 9 *************** #include<iostream.h> int a=3; void demo(int x, int y,int &z) { a+=x+y; z=a+y; y+=x; cout<<x<<" "<<y<<" "<<z<<endl; } void main() { int a=2,b=5; demo(::a,a,b); cout<<::a<<" " <<a<<" "<<b<<endl; demo(::a,a,b); } //*****************Program 10 *************** #include<iostream.h> int max(int &x,int &y,int &z) { if(x>y &&y>z) {
  • 7. y++; z++; return x; } else if(y>x) return y; else return z; } void main() { int a=10,b=13,c=8; a=max(a,b,c); cout<<a<<b<<c<<endl; b=max(a,b,c); cout<<++a<<++b<<++c<<endl; } //*****************Program 11 *************** #include<iostream.h> #include<conio.h> #include<string.h> #include<ctype.h> void main() { clrscr(); int a=32,*X=&a;
  • 8. char ch=65,&cho=ch; cho+=a; *X+=ch; cout<<a<<','<<ch<<endl; } //*****************Program 12 *************** #include<iostream.h> struct point { int x,y; }; void show(point p) { cout<<p.x<<';'<<p.y<<endl; } void main() { point U={0,10},V,W; V=U; V.x+=0; W=V; U.y+=10; U.x+=5; W.x-=5; show(U); show(V);
  • 9. show(W); } //************** Program 13 *************** #include<iostream.h> void main() { int x[]={10,20,30,40,50}; int *p,**q; int *t; p=x; t=x+1; q=&t; cout<<*p<<','<<**q<<','<<*t++; } #include<iostream.h> #include<conio.h> #include<string.h> #include<ctype.h> class state { char *statename; int size; public: state()
  • 10. { size=0; statename=new char[size+1]; } void display() { cout<<statename<<endl; } state(char *s) { size=strlen(s); statename=new char[size+1]; strcpy(statename,s); } void replace(state &a, state &b) { size=a.size+b.size; delete statename; statename=new char[size+1]; strcpy(statename,a.statename); strcat(statename,b.statename); } }; void main() { char *temp="Delhi"; state state1(temp),state2("mumbai"),state3("Nagpur"),S1,S2; S1.replace(state1,state2); S2.replace(S1,state3); S1.display(); S2.display();
  • 11. } */ #include<iostream.h> #include<conio.h> #include<string.h> #include<ctype.h> void main() { clrscr(); long NUM=1234543; int f=0,s=0; do{ int rem=NUM%10; if(rem%2==0) f+=rem; else s+=rem; NUM/=10; }while(NUM>0); cout<<f-s; } /************** OUTPUT Program 1 *************** L LA LAN
  • 12. LAND ************** OUTPUT Program 2 *************** A= 10B= -1 A= 7B= -1 ************** OUTPUT Program 3 *************** i ers and strings n ************** OUTPUT Program 4 *************** 20400420 2020420 ************** OUTPUT Program 5 *************** New message :EBJEEt ************** OUTPUT Program 6 *************** 50 240 290 340 240 340 240 22 ************** OUTPUT Program 7 *************** Value is Pass New value is Best Of luck ************** OUTPUT Program 8 *************** GOODLUCK GOODLUC GOODLU
  • 13. GOODL GOOD GOO GO ************** OUTPUT Program 9 *************** 3 5 10 8 2 10 8 10 20 ************** OUTPUT Program 10 *************** 13138 1499 ************** OUTPUT Program 11 *************** 129,a ************** OUTPUT Program 12 *************** 5;20 0;10 -5;10 ************** OUTPUT Program 13 *************** 10,30,20 ************** OUTPUT Program 14 *************** Delhimumbai DelhimumbaiNagpur
  • 14. ************** OUTPUT Program 15 *************** -2 */