Karol Sousa

Binary Search Program in CPP(C++)

 This program contains some errors you need to remove. ___________________________________________________ #include<iostream> using namespace std; class BinarySearch { int i; int n; public: void b_search(int *, int, int); }; void BinarySearch :: b_search(int a[],int n, int dataitem) { int start, end, mid, index, f=0; start=0; end = n-1; cout<<“Enter data item to be searched”; while( (start […]

Binary Search Program in CPP(C++) Read More »

Structures in C Programming

Structures in C Programming Structures are salient features of C programming language and it is a user defined data type that packages integer, float and character data types. Furthermore, the addresses of data members in a structure are contiguous as you can see in the example. ________________________________ #include<stdio.h> struct student_record { int id_no; int age;

Structures in C Programming Read More »

Templates in C++

Templates are used to support generic programming  in C++, what happens when you need a function of a class that takes its argument  as float as well as integer. You have to declare and define two functions, the first one  takes parameters of the type integer and another float . Further,  templates make life easy,

Templates in C++ Read More »

Inheritance in C++

Inheritance in C++Inheritance is a very important feature of object-oriented programming approach. Further, which provides the mechanism of reusability of classes. Moreover, it is very important to reuse classes which are tested. And this idea also saves resources and increases the reliability of the software. Basically, there are three types( Hybrid and Hierarchical are also

Inheritance in C++ Read More »

Add Two Numbers in CPP

Add Two Numbers in CPP #include<iostream> using namespace std; int main() { int x, y, sum; cout<<” Enter Two Numbers for Addition”<<endl; cin>>x>>y; sum = x + y; cout<< “Sum of Two Numbers is”<<“n”<<sum; return 0; } ___________________________ For output see the video   See Also: Hello World Program In CPP Bubble Sort in C++

Add Two Numbers in CPP Read More »

©Postnetwork-All rights reserved.