G

@Ganeshprabhu

Oddeven_class

C++
4 years ago
#include <iostream> using namespace std; class oddeven { public : int n; void getdata(); void find(); }; void oddeven::getdata()

Emp_class

C++
4 years ago
#include <iostream> using namespace std; class employee { char name [30]; int age, num; long int salary; public : void details ();

Stud_class

C++
4 years ago
#include <iostream> using namespace std; int main() { class student { int rollno; char name[30]; int mark [4],total; float avg;

String

C++
4 years ago
#include <iostream> #include <string> using namespace std; int main() { char s1[10]="hello"; char s2[10]="world"; char s3[10]; int len, n; cout <<"Enter the number to perform task"; cin>>n;

Class

C++
4 years ago
#include <iostream> using namespace std; int main() { class find { private: int num; public : void getdata(); void calculate();

Default argument

C++
4 years ago
#include <iostream> using namespace std; int main() { float amount; float value (float p, int n, float r=0.15); amount =value (5000.00,5); cout <<"Final value :"<<amount; return 0; } float value(float p, int n, float r=0.15)

Bank interst

C++
4 years ago
#include <iostream> using namespace std; int main() { float amount; float value (float p, int n, float r=0.15); amount =value (5000.00,5); cout <<"Final value :"<<amount; return 0; } float value(float p, int n, float r=0.15)

Inline function

C++
4 years ago
#include <iostream> using namespace std; inline int add (int a, int b) {return (a+b);} inline int sub (int m, int n) {return (m-n);} int main() { int x=30,y=20; cout <<add (x, y)<<endl; cout << sub (x, y)<<endl;

Inline func

C++
4 years ago
#include <iostream> using namespace std; inline float mul(float x, float y) {return (x*y);} inline double div (double p, double q) {return (p/q);} int main (){ float a=12.345; float b=9.82; cout <<mul (a, b)<<endl;

Reverse num

C++
4 years ago
#include <iostream> using namespace std; int main() { int n, r, sum=0; cout <<"Enter the number:"; cin>>n; cout<<"n="<<n<<endl; while (n>0) { r=n%10;

Greatest of four

C++
4 years ago
#include <iostream> using namespace std; int main() { int a, b, c, d; cout <<"Enter the four values :"<<endl ; cin >>a>>b>>c>>d; cout <<"a="<<a<<"\t b="<<b<<"\t c="<<c<<"\t d="<<d<<endl; if (a>b&&a>c) { if (a>d)

Num

C++
4 years ago
#include <iostream> using namespace std; int main() { long int n,sum=0,r; cout<<"Enter the Number : "<<endl; cin>>n; cout <<n<<endl; while(n>0) {

Function

C++
4 years ago
#include <iostream> using namespace std; void add(int a ,int b); void sub(int a, int b); void mul(int a, int b); int main() { int x, y; cout <<"Enter the two values "<<endl; cin>>x>>y; cout <<"x="<<x<<"\t y="<<y<<endl;

Add two num

C++
4 years ago
#include <iostream> using namespace std; void add(int a ,int b); int main() { int x, y; cout <<"Enter the two values "<<endl; cin>>x>>y; add(x, y); return 0;

Add two num

C++
4 years ago
#include <iostream> using namespace std; void add(int a ,int b); int main() { int x, y; cout <<"Enter the two values "<<endl; cin>>x>>y; add(x, y); return 0;

Setw

C++
4 years ago
#include <iostream> #include <iomanip> using namespace std; int main() { int basic=950,allowance=95,total=1045; cout <<setw(10)<<"Basic="<<setw(10)<<basic<<endl<<setw(10)<<"Allowance="<<setw(10)<<allowance <<endl<<setw(10)<<"Total="<<setw(10)<<total; return 0; }

Full pyramid num

C++
4 years ago
#include <iostream> using namespace std; int main() { int rows, space, count=0,count1=0,k=0; cout <<"Enter the no of rows "<<endl; cin>>rows; for (int i=1;i<=rows;++i) { for (space=1;space<=rows-i; ++space) {

Full pyramid

C++
4 years ago
#include <iostream> using namespace std; int main() { int space, rows; cout << "Enter the no of rows :"<<endl; cin>>rows; for (int i=1,k=0;i<=rows; ++i, k=0) { for (space=1;space<=rows-i;++space ) {

Mark list

C++
4 years ago
#include <iostream> using namespace std; int main() { int rollno; char name[30]; int m1,m2,m3,m4,m5,total,avg; cout <<"\t\t student mark list"<<endl; cout <<"****INPUT****"<<endl; cout<<"Enter the name"<<endl;

Mark list

C++
4 years ago
#include <iostream> using namespace std; int main() { int rollno; char name[30]; int m1,m2,m3,m4,m5,total,avg; cout <<"\t\t student mark list"<<endl; cout<<"Enter the name"<<endl; cin>>name; cout<<"Enter the roll no"<<endl;