Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
13 views
C++ programs
Cs
Uploaded by
jyotsnashree2021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C++ programs For Later
Download
Save
Save C++ programs For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
13 views
C++ programs
Cs
Uploaded by
jyotsnashree2021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C++ programs For Later
Carousel Previous
Carousel Next
Download
Save
Save C++ programs For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 28
Search
Fullscreen
CH Programming 3 S C++ Programming ‘Write a program to find the frequency of presence of an elelment in an array. Logic: ‘Counting the given element(EELE) for how many times it exists in an array by traversing. Initially compare ELE with first clement in an array. If first element is equal to ELE, increment the count by 1. Next compare ELE with second element, if second clementis equal to ELE, again increment the count by 1. Similarly compare ELE with all other elements until the last.clement. Whenever comparison gives true result, increment the.countiby 1. Finally display the count. Example: Finding the frequency of 25 from the following array: ~ |e [|e fs | 9 | Af) AQ] A) AB) Ala When ELE=All], Initially Count=0 ; 1=0, 25=25, (Tue) Count=Count+ 1. ‘Cout=0+1=1 1=1, 25=16, (False) No increment Count= 1 J=2, 25=67, (False) No increment ‘Count = 1 J=3, 25=25, (True) Count= Count +1. Count = 1+1=2 1=4, 25=19, (False) No increment ‘Count = 2 1=5 (Outofrange). Therefore frequency of 25 =? Program: #include
#include
#include
class Frequency { private: int n, a[100], i, ELE, freq; public: void input() ; void findfrequency() void display() ;C++ Programming void Frequency :: input( ) { cin >> nter the array elements” > ali] ; cout > ELE ; void Frequency :: findfrequency( ) { freq for(i=0; i
0) ; cout #include
#include
ah tnclude & std -h>class Insert f private: int n, af 100], i, BI public: void input() ; void insertion( ) void display( ) ;. IE, pos. 5 Le void Insert :: input() { cout >n; cout > ali} ; cout > ELE ; cout > pos ;. } : void Insert :: insertion( ) { if(pos > n) { cout =pos; i-) afi+ 1] = ali] s a[pos] = ELE ; n=nt1;C+ Programming } } void Insert :: display() { cout #include
BinclndeSiomaniDI 5 aprncbuucte { private: int n, a[100], i, ELE, pos ; public: void input() ; void deletion( ) ; void display() ; Bs void Delete :: input() t cout >n; cout > afi] 5 cout > pos 5} void Delete :: deletion( ) { if(pos > n-1) { cout #include
#include
class Sort { private: int n, a[100] ; public: void input) ;CH Programming 7 void sorting( ) ; void display( ) ; hs void Sort :: input( ) { cout >n; cout > ai] ; } void Sort :: sorting( ) { int t, j,i; for(i=1; i
= 1) { ~if(alj] #include
class Search { private: int a[100], n, ELE, loc, i; public: void input() ; void bin_search( ) ; void display() ; hs void Search :: input() { cout >n; cout > afi] ; cout > ELE ; } void Search :: bin_search( ) { int beg = 0, end=n-1, mid; loc =-1; while(beg = 0) cout #include
#include
class Interest { private: double P, T, R, SI; public: void input( ) ; void compute( ) ; void display( ) ; 33 void Interest :: input() { cout >P>>T>>R; } void Interest :: compute( ) { SI=(P*T*R)/100;, Void Interest :: display( ) { cout 0, print the real and distinct roots. 3) If the discriminant 0, roots are real and distinct, x=CH Programming 7 D #include
#include
Htaclude 2 ardkele “h> class Quadratic { private: double a, b, c, rl, 12, d; public: void getdata( ) ; void compute( ) ; void display( ) ; 35 void Quadratic :: getdata() { cout >a>>b>>c; } void Quadratic :: compute( ) { d=b*b-4*a*c; if(d = 0) { cout 0) { cout #include
Hinclude
class FindCube { public: inline int CUBE(int x) { retumn(x * x * x); } 33 void main( ) { FindCube F ; i intns CL SEED) ‘ cout > n; cout #include
class Student { private: int regno ; char name[20] ; public: void base_getdata( ) { cout > regno ; } void base_display( ) { cout > markl >> mark2 ; total = mark1 + mark2 ; } void derived_display( ) ‘ 5 cout #include
class Student { private: int regno ; char name[20] ; float fee ; public: void getdata( ) ; void display( ) ; bs void Student :: getdata() : cout > regno ; cout > name ; cout > fee;C+ Programming 21 void Student :: display( ) { cout getdata() ; ptr > display() ; getch() ; } Output: Enter the register number : 20146789 Enter the student name : Soujanya Enter the student fees : 5000.00 The student details are... Register number = $20146789 Name = Soujanya Fees = 5000.00
You might also like
II PU Lab Mannual 2023
PDF
No ratings yet
II PU Lab Mannual 2023
29 pages
11 Array: L L L L L
PDF
No ratings yet
11 Array: L L L L L
14 pages
2nd PUC Labmanual - Final
PDF
No ratings yet
2nd PUC Labmanual - Final
58 pages
Dsa Assignment 1 Anees
PDF
No ratings yet
Dsa Assignment 1 Anees
11 pages
Program No 1
PDF
No ratings yet
Program No 1
11 pages
CS Practical File SOMYA 2017-18
PDF
No ratings yet
CS Practical File SOMYA 2017-18
64 pages
CS_Datastructure_prgms
PDF
No ratings yet
CS_Datastructure_prgms
18 pages
Data Structure Lab report
PDF
No ratings yet
Data Structure Lab report
21 pages
01 - Ca2 - Bcac 303
PDF
No ratings yet
01 - Ca2 - Bcac 303
21 pages
2 PUC C++ Programs
PDF
100% (1)
2 PUC C++ Programs
5 pages
lab manual
PDF
No ratings yet
lab manual
86 pages
DS Programs
PDF
No ratings yet
DS Programs
34 pages
DSA Practical File (Yash Goyal, 1902941)
PDF
No ratings yet
DSA Practical File (Yash Goyal, 1902941)
98 pages
2nd_year_programs (1) (1) (1)
PDF
No ratings yet
2nd_year_programs (1) (1) (1)
21 pages
How To Stored Value in The Memorey With Figures and Examples 1D and 2D Array
PDF
No ratings yet
How To Stored Value in The Memorey With Figures and Examples 1D and 2D Array
22 pages
DS - BCA I (All Program)
PDF
No ratings yet
DS - BCA I (All Program)
29 pages
My_Manual
PDF
No ratings yet
My_Manual
32 pages
ACA_Lab
PDF
No ratings yet
ACA_Lab
61 pages
DSA Lab File
PDF
No ratings yet
DSA Lab File
33 pages
Lab Manual 2nd Year 2022
PDF
No ratings yet
Lab Manual 2nd Year 2022
80 pages
Dsa File Programs
PDF
No ratings yet
Dsa File Programs
26 pages
Tayeb D.S
PDF
No ratings yet
Tayeb D.S
23 pages
DS Exp 1 Diya1
PDF
No ratings yet
DS Exp 1 Diya1
9 pages
Organized
PDF
No ratings yet
Organized
8 pages
Cs C++
PDF
No ratings yet
Cs C++
64 pages
DSA Lab Manual
PDF
No ratings yet
DSA Lab Manual
35 pages
IIPU.manual Converted
PDF
No ratings yet
IIPU.manual Converted
47 pages
DFS Lab File Final
PDF
No ratings yet
DFS Lab File Final
99 pages
Abdurahman Lab 2 Dsa
PDF
No ratings yet
Abdurahman Lab 2 Dsa
14 pages
Data Structures and Algorithm Lab
PDF
No ratings yet
Data Structures and Algorithm Lab
81 pages
Unit 1
PDF
No ratings yet
Unit 1
86 pages
Assignment of Computer Programming
PDF
No ratings yet
Assignment of Computer Programming
8 pages
Assignment-2
PDF
No ratings yet
Assignment-2
24 pages
all_of_3
PDF
No ratings yet
all_of_3
56 pages
DSA - Practical: Array Using Switch Case
PDF
No ratings yet
DSA - Practical: Array Using Switch Case
89 pages
Computer Science C++ Project
PDF
No ratings yet
Computer Science C++ Project
102 pages
Practical File On Data Structures Using C++: Submitted To: Submitted by
PDF
No ratings yet
Practical File On Data Structures Using C++: Submitted To: Submitted by
51 pages
1-12(Lab Programs)
PDF
No ratings yet
1-12(Lab Programs)
21 pages
1D Array
PDF
No ratings yet
1D Array
6 pages
Programs of C++ For Class 12 Cbse
PDF
43% (7)
Programs of C++ For Class 12 Cbse
85 pages
Manish
PDF
No ratings yet
Manish
14 pages
A- 311
PDF
No ratings yet
A- 311
60 pages
Traversing
PDF
No ratings yet
Traversing
15 pages
LAB MANUAL DSA
PDF
No ratings yet
LAB MANUAL DSA
18 pages
Dslab Final 2.2 LNX
PDF
No ratings yet
Dslab Final 2.2 LNX
35 pages
Chapter 12 Cs Programs
PDF
No ratings yet
Chapter 12 Cs Programs
13 pages
DSA Lab Report-14th Batch
PDF
No ratings yet
DSA Lab Report-14th Batch
26 pages
ADI PRACTICAL(AGAMJOT_SINGH-2210997017)_241021_151914
PDF
No ratings yet
ADI PRACTICAL(AGAMJOT_SINGH-2210997017)_241021_151914
66 pages
Devraj
PDF
No ratings yet
Devraj
14 pages
DS Worksheet 2 Alasso
PDF
No ratings yet
DS Worksheet 2 Alasso
3 pages
Array inset ,dell ,search
PDF
No ratings yet
Array inset ,dell ,search
7 pages
1150 Ishaan
PDF
No ratings yet
1150 Ishaan
74 pages
C++ (CPP) Programs With Numerical Problems
PDF
No ratings yet
C++ (CPP) Programs With Numerical Problems
48 pages
CS3401- Algorithm lab Manual
PDF
No ratings yet
CS3401- Algorithm lab Manual
73 pages
Dsa Lab File
PDF
No ratings yet
Dsa Lab File
97 pages
Dsa Assign 1
PDF
No ratings yet
Dsa Assign 1
7 pages
Linear Array
PDF
No ratings yet
Linear Array
26 pages
Lab Manual Ds - 2021
PDF
No ratings yet
Lab Manual Ds - 2021
57 pages