Program of Oops
Program of Oops
char str[40];
cout << "\n" << "Entered string is: " << str << "\n"; //output string
getch();
system("pause");
}
Output 1:-
//Program 2
int n1,n2,n3,avg;
cout << "Enter the three numbers\n" << "\n" ; //inputing the numbers
avg=(n1+n2+n3)/3;
cout << "avg of " << n1 << ", " << n2 << " and " << n3 << " is : " << avg << "\n"; //result
getch();
system("pause");
}
Output 2:-
//Program 3
int n1,n2,product;
cout << "product of " << n1 << " and " << n2 << " is : " << product << "\n"; // result
getch();
system("pause");
int e;
return(e);
}
Output 3:-
//Program 4
public:
void info(void)
};
height=b;
cost=c;
}
//int type main program
int main()
getch();
system("pause");
}
Output 4:-
//Program 5
return(a*b);
return(p/q);
int main()
float a= 12.345;
float b= 9.82;
system(”pause”);
}
//Program 6
#include<iostream.h>
//Declaration (prototypes)
int volume(int);
double volume(double,int);
long volume(long,int,int);
int main()
return 0;
system("pause");
//function definitions
return(s*s*s);
return(3.14519*r*r*h);
{
return(l*b*h);