G

@gayatrishelke

avg of 5 numbers

C++
2 years ago
#include<iostream> using namespace std; int main() { int sum=0,avg=0,i,a,n; cout<<"enter the number of you reduired"<<endl; cin>>n; for(i=0;i<n;i++) { cout<<"enter the numbers"<<i+1<<endl;

exception handling using virtual function

C++
2 years ago
#include <iostream> #include <exception> #include <string> using namespace std; class UserException : public exception { private: string msg; public: UserException (string m) {

Exception handling using virtual function

C++
2 years ago
#include <iostream> #include <string> using namespace std; class InvalidData : public std::exception { public: explicit InvalidData(const std::string& message) : std::exception(message.c_str()) {} }; class User {

exception handling

C++
2 years ago
#include<iostream> #include<string.h> using namespace std; class Exceptionhandling { private: int age,vehicle; long double income; string city; public:

manager details using exception handling

C++
2 years ago
#include <iostream> #include <string> using namespace std; class Employee { private: string name; int age; double salary; public: Employee() {

managers details using friend function

C++
2 years ago
#include <iostream> using namespace std; class employee { private: char name[20]; int age; int salary;

managers details using virtual function

C++
2 years ago
#include <iostream> using namespace std; class Employee { protected: string name; int age; double salary; public:

manager details using inheritance

C++
2 years ago
#include <iostream> using namespace std; class Employee { protected: string name; int age; double salary; public:

swapping of two numbers using friend function

C++
2 years ago
#include <iostream> using namespace std; class A { private: int a,b; public: void get_data()

exception handling using friend function

C++
2 years ago
#include <iostream> using namespace std; class Exp_handling { private: int age, vehicle; long double income; string city; public:

volume of different shapes using virtual function

C++
2 years ago
#include<iostream> using namespace std; class Shape { public: virtual double volume() = 0; }; class Cube : public Shape { private: int length; public:

swapping of two numbers using virtual function

C++
2 years ago
#include<iostream> using namespace std; class Swap { public: virtual void swap(int &a, int &b) = 0; }; class SwapNumbers : public Swap { public: void swap(int &a, int &b) { int temp = a;

student result analysis by virtual function

C++
2 years ago
#include<iostream> using namespace std; class Analysis { protected: int id; int res; public: Analysis()

power of number using virtual function

C++
2 years ago
#include <iostream> #include <cmath> using namespace std; class Number { protected: double value; public: Number(double value)

average of 5 numbers using virtual function

C++
2 years ago
#include <iostream> using namespace std; class Number { protected: double value; public: Number(double v) { value = v; }

exception handling using inheritance

C++
2 years ago
#include<iostream> #include<string.h> using namespace std; class User { protected: int age, vehicle; long double income; string city;

swap of two numbers using inheritance

C++
2 years ago
#include <iostream> using namespace std; class Base { protected: int a, b; public:

swapping of two numbers using exception handling

C++
2 years ago
#include<iostream> using namespace std; class BB; class AA { private: int v1; public: void setdata(int val) {

volume of different shapes using exception handling

C++
2 years ago
#include<iostream> using namespace std; class NegativeDimensionException : public exception { public: int h; const char* what() const throw() { return "Negative dimension is not allowed"; }

volume of different shapes using inheritance

C++
2 years ago
#include<iostream> using namespace std; class Shape { protected: int l, b, h; double r, h1; public: