SlideShare ist ein Scribd-Unternehmen logo
1 von 14
/******************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
*/

Weitere ähnliche Inhalte

Was ist angesagt?

20181020 advanced higher-order function
20181020 advanced higher-order function20181020 advanced higher-order function
20181020 advanced higher-order functionChiwon Song
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.jsNoritada Shimizu
 
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import *  k=1 def f(x): return (exp(-(x...Part2 from math import * from simpson import *  k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...hwbloom25
 
20180721 code defragment
20180721 code defragment20180721 code defragment
20180721 code defragmentChiwon Song
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲームNoritada Shimizu
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveEugene Zharkov
 
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
Продвинутая отладка JavaScript с помощью Chrome Dev ToolsПродвинутая отладка JavaScript с помощью Chrome Dev Tools
Продвинутая отладка JavaScript с помощью Chrome Dev ToolsFDConf
 
VLSI Sequential Circuits II
VLSI Sequential Circuits IIVLSI Sequential Circuits II
VLSI Sequential Circuits IIGouthaman V
 

Was ist angesagt? (20)

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

Ähnlich wie Program(Output)

Assignement c++
Assignement c++Assignement c++
Assignement c++Syed Umair
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_papervandna123
 
Project hotel on hotel management fo
Project  hotel on hotel management foProject  hotel on hotel management fo
Project hotel on hotel management foSunny Singhania
 
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)Syed Umair
 
Program of sorting using shell sort #include stdio.h #de.pdf
 Program of sorting using shell sort  #include stdio.h #de.pdf Program of sorting using shell sort  #include stdio.h #de.pdf
Program of sorting using shell sort #include stdio.h #de.pdfanujmkt
 
operating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfoperating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfaptcomputerzone
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++Syed Umair
 
寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)均民 戴
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
#include iostream #include fstream #include iomanip #.pdf
 #include iostream #include fstream #include iomanip #.pdf #include iostream #include fstream #include iomanip #.pdf
#include iostream #include fstream #include iomanip #.pdfKARTIKINDIA
 

Ähnlich wie Program(Output) (20)

Assignement c++
Assignement c++Assignement c++
Assignement c++
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Project hotel on hotel management fo
Project  hotel on hotel management foProject  hotel on hotel management fo
Project hotel on hotel management fo
 
C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
 
Qno 1 (d)
Qno 1 (d)Qno 1 (d)
Qno 1 (d)
 
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)
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
Program of sorting using shell sort #include stdio.h #de.pdf
 Program of sorting using shell sort  #include stdio.h #de.pdf Program of sorting using shell sort  #include stdio.h #de.pdf
Program of sorting using shell sort #include stdio.h #de.pdf
 
operating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfoperating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdf
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
 
寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)寫程式?那些老師沒教的事 (Git 部分節錄)
寫程式?那些老師沒教的事 (Git 部分節錄)
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
Pemrograman visual
Pemrograman visualPemrograman visual
Pemrograman visual
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
#include iostream #include fstream #include iomanip #.pdf
 #include iostream #include fstream #include iomanip #.pdf #include iostream #include fstream #include iomanip #.pdf
#include iostream #include fstream #include iomanip #.pdf
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Kürzlich hochgeladen (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet 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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

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 */