C++

C ++ Programmes

Posted on

Write a Program that Gets Five Inputs from the User in an Array and then Sorts this Array in Ascending Order. Write a Program that Stores Five Values in an Array. It Sorts the Array Using Bubble Sort. It also Displays the Values of Unsorted and Sorted Array. Write a Program to Implement Virtual Function. […]

C++

Write a Program to implement function Overriding.

Posted on

#include<iostream.h> #include<conio.h> class A { int a,b; public: void read() { cin>>a>>b; } void show() { cout<<a<<b; } }; class B:public A { int c,d; public: void read() { A::read() cout<<“Enter c and d”; cin>>c>>d; } void show() { A::show(); cout<<“value of c and d”; } }; main() { B d1; b1.read(); b1.show(); }

C++

Write a Program to implement Call By Reference.

Posted on

#include <iostream> #include <conio.h> using namespace std; void swap(int *, int *); main() { int a, b; cout << “Enter Two Numbers: “; cin >> a >> b; cout << “\nBefore Swapping:\n”; cout << “\na = ” << a << ” b = ” << b; cout << “\n\nAfter Swapping:\n”; swap(&a, &b); getch(); } void […]

C++

Write a Program to implement Call By Value.

Posted on

#include <iostream> #include <conio.h> using namespace std; void swap(int, int); main() { int a, b; cout << “Enter two numbers: “; cin >> a >> b; cout << “\nBefore Swapping:\n”; cout << “\na = ” << a << ” b = ” << b; cout << “\n\nAfter Swapping:\n”; swap(a, b); getch() } void swap(int x, […]