C++ program to print the students marks

/*C++ program to print the students marks*/ #include<iostream.h> #include<conio.h> void main() { int sno,m1,m2,m3,tot; float avg; clrscr(); cout<<“enter sno,m1,m2,m3:”; cin>>sno>>m1>>m2>>m3; tot=m1+m2+m3; avg=tot/3; cout<<“\n sno=”<<sno; cout<<“\n m1=”<<m1; cout<<“\n m2=”<<m2; cout<<“\n m3=”<<m3; cout<<“\n tot=”<<tot; cout<<“\n avg=”<<avg; if(avg>=90) { cout<<“\n distinction”; } else if(avg>=60) { cout<<“\n first class”; } else if(avg>=50) { cout<<“\n second class”; } else if(avg>=40)…

46,990 total views, 182 views today

Read More

C++ program to find greatest of three numbers using if-else-if

/*C++ program to find greatest of three numbers using if-else-if*/ #include<iostream.h> #include<conio.h> void main() { int a,b,c; clrscr(); cout<<“enter the values of a,b,c:”; cin>>a>>b>>c; if(a>b&&a>c); { cout<<“a is greater”; } else if(b>c) { cout<<“b is greater”; } else { cout<<“c is greater”; } getch(); } 53,295 total views, 260 views today

53,295 total views, 260 views today

Read More

C++ program to print the given numbers in ascending order

/*C++ program to print the given numbers in ascending order*/ #include<iostream.h> #include<conio.h> void main() { int a,b,c; clrscr(); cout<<“enter the values of a,b,c”; cin>>a>>b>>c; if(a<b&&a<c) { if(b<c) { cout<<a<<” “<<c<<” “<<b; } else { cout<<a<<” “<<c<<” “<<b; } } else if(b<c) { if(a<c) { cout<<b<<” “<<a<<” “<<c; } else { cout<<b<<” “<<c<<” “<<a; } }…

36,465 total views, 8 views today

Read More

C++ PROGRAM TO FIND THE CUSTOMER ELECTRICITY BILL DETAILS BASED ON CUSTOMER TYPE

#include<iostream.h> #include<conio.h> void main() { int mno,pres,prev,nounits,ctype; float rpu,tbill; clrscr(); cout<<“enter mno,pres,prev readings:”; cin>>mno>>pres>>prev; nounits=pres-prev; cout<<“enter ctype:”; cin>>ctype; if(ctype==1) { rpu=1.00; } if(ctype==2) { rpu=2.00; } if(ctype==3) { rpu=3.00; } if(ctype==4) { rpu=4.00; } if(ctype==5) { rpu=5.00; } tbill=nounits*rpu; cout<<“\n pres reading=”<<pres; cout<<“\n prev reading=”<<prev; cout<<“\n nounits=”<<nounits; cout<<“\n rpu=”<<rpu; cout<<“\n tbill=”<<tbill; getch(); } 39,922 total views,…

39,922 total views, 62 views today

Read More