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)…

31,951 total views, 352 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(); } 38,986 total views, 220 views today

38,986 total views, 220 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; } }…

26,551 total views, 264 views today

Read More