SlideShare a Scribd company logo
1 of 17
Programs:-
Structure
#include<iostream.h>
#include<conio.h>
struct student
{
char Name[20];
int Rollno;
};
student s[5];
void main()
{
int i;
for(i=0;i<=4;i++)
{
cout<<"Enter Name:";
cin.getline(s[1].Name,20);
cout<<"Enter Rollno :";
cin>>s[i].Rollno;
cout<<endl;
}
for(i=0;i<=4;i++)
{
cout<<"Your Name is :"<<s[i].Name<<endl;
cout<<endl;
cout<<"Your Roll No is :"<<s[i].Rollno<<endl;
cout<<endl;
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
int a[10],i,max;
for(i=0;i<10;i++)
{
cout<<"Enter a value:";
cin>>a[i];
}
max=a[0];
for(i=0;i<10;i++)
if(max<a[i])
max=a[i];
cout<<"Maximum Value :"<<max<<endl;
getch();
}
#include<iostream.h>
#include<conio.h>
void abc();
struct info
{
int rollno;
int age;
};
struct book
{
int pages;
int price;
};
info in;
book b;
void main()
{
cout<<endl;
cout<<"tt....Your Nested Structure Programming...."<<endl;
cout<<endl;
cout<<endl;
cout<<"Enter Your Roll no :";
cin>>in.rollno;
cout<<"Enter Your Book pages:";
cin>>b.pages;
cout<<"Enter your Age:";
cin>>in.age;
cout<<"Enter Your Book Price:";
cin>>b.price;
cout<<endl;
cout<<endl;
cout<<"your Roll no:"<<in.rollno<<endl;
cout<<"Your Book Pages:"<<b.pages<<endl;
cout<<"Your Age :"<<in.age<<endl;
cout<<"Your Price:"<<b.price<<endl;
getch();
}
Pointers:-
#include<iostream.h>
#include<conio.h>
void abc(int &);
void abc(int &a)
{
int m;
cout<<"Enter A Value:";
cin>>m;
cout<<"Your pass "<<a<<endl;
a=a+m;
// cout<<"The value is:"<<a<<endl;
}
void main()
{
int v_actual;
cout<<"Enter a value:";
cin>>v_actual;
cout<<"your actual value is:"<<v_actual<<endl;
abc(v_actual);
cout<<"Your value:"<<v_actual<<endl;
getch();
}
Structure:-
#include<iostream.h>
#include<conio.h>
struct student
{
char Name[30];
char Fname[30];
int Rollno;
};
student s;
void main()
{
cout<<"Enter Name :";
cin>>s.Name;
cout<<endl;
cout<<"Enter Father Name :";
cin>>s.Fname;
cout<<endl;
cout<<"Enter Rollno :";
cin>>s.Rollno;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"Your Name is :"<<s.Name<<endl;
cout<<endl;
cout<<"Your Father Name is :"<<s.Fname<<endl;
cout<<endl;
cout<<"Your Roll No is :"<<s.Rollno<<endl;
getch();
}
Function and structure:-
#include<iostream.h>
#include<conio.h>
void abc();
struct info
{
int rollno;
int age;
};
info s;
void main()
{
for(int i=0;i<=5;i++)
{
abc();
}
getch();
}
void abc()
{
cout<<"Enter a rollno:";
cin>>s.rollno;
cout<<s.rollno<<endl;
}
Arrays of Structure:-
#include<iostream.h>
#include<conio.h>
struct student
{
char Name[30];
char Fname[30];
int Rollno;
};
student s[5];
void main()
{
for(int i=0;i<=5;i++)
{
cout<<"Enter Name :";
cin.getline(s[i].Name,30);
cout<<endl;
cout<<"Enter Father Name :";
cin.getline(s[i].Fname,30);
cout<<endl;
}
for(i=0;i<=5;i++)
{
cout<<"Enter Rollno :";
cin>>s[i].Rollno;
cout<<endl;
}
cout<<endl;
cout<<endl;
cout<<endl;
for(i=0;i<=5;i++)
{
cout<<"Your Name is :"<<s[i].Name<<endl;
cout<<endl;
cout<<"Your Father Name is :"<<s[i].Fname<<endl;
cout<<endl;
}
for(i=0;i<=5;i++)
{
cout<<"Your Roll No is :"<<s[i].Rollno<<endl;
}
getch();
}
Function:-
#include<iostream.h> //header files
#include<conio.h>
void function(); // function declaration...
int c; //Global variable declaration..
void function() //function starting point..
{
int a,b;
cout<<"Enter a number:";
cin>>a;
cout<<"Enter b number:";
cin>>b;
c=a+b;
}
void main()
{
function(); //function call...
cout<<c<<endl;
getch();
}
Function with return value:-
#include<iostream.h> //header files
#include<conio.h>
int function(); // function declaration...
int function() //function starting point..
{
int a,b;
cout<<"Enter a number:";
cin>>a;
cout<<"Enter b number:";
cin>>b;
return a*b;
}
int main()
{
int x=0; //Local declaration of variable.....
x=function();
cout<<"Your return value in function is:"<<x<<endl;
return 0;
}
Parameters:-
#include<iostream.h>
#include<conio.h>
void getdata(int a);
void getdata(int a)
{
int b;
cout<<"The value which is pass is as:"<<a;
b=a*a;
cout<<"The value of b is :"<<b<<endl;
}
void main(){
int x;
cout<<"Entera number :";
cin>>x;
getdata(x);
cout<<"The value of is as :"<<x<<endl;
getch();
}
Return Function with Parameter:-
#include<iostream.h>//header files
#include<conio.h>
int function(inta,int b); // function declarationwith
Parameter...
int function(inta,int b) //function starting point..
{
int ans=a+b;
return ans;
}
void main()
{
int a,b;
cout<<"Entera vlue:";
cin>>a;
cout<<"Enterb value:";
cin>>b;
cout<<function(a,b)<<endl;
getch();
}
return with parameter:-
#include<iostream.h>
#include<conio.h>
int abc(int,int);
int abc(int a, int b){
int m;
m*m;
cout<<"The value of m is:"<<m;
return m*m;
}
void main()
{
int x;
x=abc(x,x);
cout<<"The value returned by function" <<x;
getch();
}

More Related Content

What's hot

Python Part 1
Python Part 1Python Part 1
Python Part 1Sunil OS
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshuSidd Singh
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++Pranav Ghildiyal
 
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programsharman kaur
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cppNilesh Dalvi
 
JAVA Variables and Operators
JAVA Variables and OperatorsJAVA Variables and Operators
JAVA Variables and OperatorsSunil OS
 
Bca 2nd sem u-2 classes & objects
Bca 2nd sem u-2 classes & objectsBca 2nd sem u-2 classes & objects
Bca 2nd sem u-2 classes & objectsRai University
 
Oop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiOop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiMuhammed Thanveer M
 
#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class StructureHadziq Fabroyir
 
Java 8 - CJ
Java 8 - CJJava 8 - CJ
Java 8 - CJSunil OS
 
Advanced Programming C++
Advanced Programming C++Advanced Programming C++
Advanced Programming C++guestf0562b
 

What's hot (20)

Python Part 1
Python Part 1Python Part 1
Python Part 1
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshu
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++
 
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programs
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
JAVA Variables and Operators
JAVA Variables and OperatorsJAVA Variables and Operators
JAVA Variables and Operators
 
C++ book
C++ bookC++ book
C++ book
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
Bca 2nd sem u-2 classes & objects
Bca 2nd sem u-2 classes & objectsBca 2nd sem u-2 classes & objects
Bca 2nd sem u-2 classes & objects
 
C++11
C++11C++11
C++11
 
Oop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiOop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer Melayi
 
#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure
 
Java 8 - CJ
Java 8 - CJJava 8 - CJ
Java 8 - CJ
 
C Basics
C BasicsC Basics
C Basics
 
basics of c++
basics of c++basics of c++
basics of c++
 
Constructor and destructor in C++
Constructor and destructor in C++Constructor and destructor in C++
Constructor and destructor in C++
 
Advanced Programming C++
Advanced Programming C++Advanced Programming C++
Advanced Programming C++
 
Diff between c and c++
Diff between c and c++Diff between c and c++
Diff between c and c++
 

Viewers also liked

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklistilsamaryum
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++Bharat Kalia
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++Ankit Kumar
 
Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500ilsamaryum
 

Viewers also liked (11)

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Loops
LoopsLoops
Loops
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C++ programs
C++ programsC++ programs
C++ programs
 

Similar to Programs of C++

C++ programming structure & union
C++ programming structure & unionC++ programming structure & union
C++ programming structure & unionargusacademy
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical fileMitul Patel
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfHIMANSUKUMAR12
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st StudyChris Ohk
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual finalAhalyaR
 
Update include ltiostreamgt include ltfstreamgt .pdf
Update  include ltiostreamgt include ltfstreamgt .pdfUpdate  include ltiostreamgt include ltfstreamgt .pdf
Update include ltiostreamgt include ltfstreamgt .pdfadityacommunications2
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++Syed Umair
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
Programa.eje
Programa.ejePrograma.eje
Programa.ejeguapi387
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++ Arun Nair
 
Bhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearBhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearDezyneecole
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control StructureMohammad Shaker
 

Similar to Programs of C++ (20)

C++ programming structure & union
C++ programming structure & unionC++ programming structure & union
C++ programming structure & union
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical file
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 
Problemas de Arreglos en c++
Problemas de Arreglos en c++Problemas de Arreglos en c++
Problemas de Arreglos en c++
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Update include ltiostreamgt include ltfstreamgt .pdf
Update  include ltiostreamgt include ltfstreamgt .pdfUpdate  include ltiostreamgt include ltfstreamgt .pdf
Update include ltiostreamgt include ltfstreamgt .pdf
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
Programa.eje
Programa.ejePrograma.eje
Programa.eje
 
Cmptr ass
Cmptr assCmptr ass
Cmptr ass
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++
 
Bhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearBhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third Year
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
P5
P5P5
P5
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
C++ L07-Struct
C++ L07-StructC++ L07-Struct
C++ L07-Struct
 
Notes
NotesNotes
Notes
 

Recently uploaded

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 

Recently uploaded (20)

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 

Programs of C++

  • 1. Programs:- Structure #include<iostream.h> #include<conio.h> struct student { char Name[20]; int Rollno; }; student s[5]; void main() { int i; for(i=0;i<=4;i++) { cout<<"Enter Name:"; cin.getline(s[1].Name,20);
  • 2. cout<<"Enter Rollno :"; cin>>s[i].Rollno; cout<<endl; } for(i=0;i<=4;i++) { cout<<"Your Name is :"<<s[i].Name<<endl; cout<<endl; cout<<"Your Roll No is :"<<s[i].Rollno<<endl; cout<<endl; } getch(); } #include<iostream.h> #include<conio.h> void main() { int a[10],i,max; for(i=0;i<10;i++) {
  • 3. cout<<"Enter a value:"; cin>>a[i]; } max=a[0]; for(i=0;i<10;i++) if(max<a[i]) max=a[i]; cout<<"Maximum Value :"<<max<<endl; getch(); } #include<iostream.h> #include<conio.h> void abc(); struct info { int rollno; int age; }; struct book {
  • 4. int pages; int price; }; info in; book b; void main() { cout<<endl; cout<<"tt....Your Nested Structure Programming...."<<endl; cout<<endl; cout<<endl; cout<<"Enter Your Roll no :"; cin>>in.rollno; cout<<"Enter Your Book pages:"; cin>>b.pages; cout<<"Enter your Age:"; cin>>in.age; cout<<"Enter Your Book Price:"; cin>>b.price; cout<<endl; cout<<endl;
  • 5. cout<<"your Roll no:"<<in.rollno<<endl; cout<<"Your Book Pages:"<<b.pages<<endl; cout<<"Your Age :"<<in.age<<endl; cout<<"Your Price:"<<b.price<<endl; getch(); } Pointers:- #include<iostream.h> #include<conio.h> void abc(int &); void abc(int &a) { int m; cout<<"Enter A Value:"; cin>>m; cout<<"Your pass "<<a<<endl; a=a+m; // cout<<"The value is:"<<a<<endl; }
  • 6. void main() { int v_actual; cout<<"Enter a value:"; cin>>v_actual; cout<<"your actual value is:"<<v_actual<<endl; abc(v_actual); cout<<"Your value:"<<v_actual<<endl; getch(); } Structure:- #include<iostream.h> #include<conio.h> struct student { char Name[30]; char Fname[30]; int Rollno; }; student s; void main()
  • 7. { cout<<"Enter Name :"; cin>>s.Name; cout<<endl; cout<<"Enter Father Name :"; cin>>s.Fname; cout<<endl; cout<<"Enter Rollno :"; cin>>s.Rollno; cout<<endl; cout<<endl; cout<<endl; cout<<endl; cout<<"Your Name is :"<<s.Name<<endl; cout<<endl; cout<<"Your Father Name is :"<<s.Fname<<endl; cout<<endl;
  • 8. cout<<"Your Roll No is :"<<s.Rollno<<endl; getch(); } Function and structure:- #include<iostream.h> #include<conio.h> void abc(); struct info { int rollno; int age; }; info s; void main() { for(int i=0;i<=5;i++) { abc(); }
  • 9. getch(); } void abc() { cout<<"Enter a rollno:"; cin>>s.rollno; cout<<s.rollno<<endl; } Arrays of Structure:- #include<iostream.h> #include<conio.h> struct student { char Name[30]; char Fname[30]; int Rollno; }; student s[5];
  • 10. void main() { for(int i=0;i<=5;i++) { cout<<"Enter Name :"; cin.getline(s[i].Name,30); cout<<endl; cout<<"Enter Father Name :"; cin.getline(s[i].Fname,30); cout<<endl; } for(i=0;i<=5;i++) { cout<<"Enter Rollno :"; cin>>s[i].Rollno; cout<<endl; } cout<<endl; cout<<endl; cout<<endl; for(i=0;i<=5;i++)
  • 11. { cout<<"Your Name is :"<<s[i].Name<<endl; cout<<endl; cout<<"Your Father Name is :"<<s[i].Fname<<endl; cout<<endl; } for(i=0;i<=5;i++) { cout<<"Your Roll No is :"<<s[i].Rollno<<endl; } getch(); } Function:- #include<iostream.h> //header files #include<conio.h> void function(); // function declaration... int c; //Global variable declaration.. void function() //function starting point.. { int a,b; cout<<"Enter a number:";
  • 12. cin>>a; cout<<"Enter b number:"; cin>>b; c=a+b; } void main() { function(); //function call... cout<<c<<endl; getch(); } Function with return value:- #include<iostream.h> //header files #include<conio.h> int function(); // function declaration... int function() //function starting point.. { int a,b;
  • 13. cout<<"Enter a number:"; cin>>a; cout<<"Enter b number:"; cin>>b; return a*b; } int main() { int x=0; //Local declaration of variable..... x=function(); cout<<"Your return value in function is:"<<x<<endl; return 0; } Parameters:- #include<iostream.h> #include<conio.h> void getdata(int a);
  • 14. void getdata(int a) { int b; cout<<"The value which is pass is as:"<<a; b=a*a; cout<<"The value of b is :"<<b<<endl; } void main(){ int x; cout<<"Entera number :"; cin>>x; getdata(x); cout<<"The value of is as :"<<x<<endl; getch(); } Return Function with Parameter:- #include<iostream.h>//header files
  • 15. #include<conio.h> int function(inta,int b); // function declarationwith Parameter... int function(inta,int b) //function starting point.. { int ans=a+b; return ans; } void main() { int a,b; cout<<"Entera vlue:"; cin>>a; cout<<"Enterb value:"; cin>>b;
  • 16. cout<<function(a,b)<<endl; getch(); } return with parameter:- #include<iostream.h> #include<conio.h> int abc(int,int); int abc(int a, int b){ int m; m*m; cout<<"The value of m is:"<<m; return m*m; } void main() { int x; x=abc(x,x);
  • 17. cout<<"The value returned by function" <<x; getch(); }