c++ course part 3

  C++ COURSE BY Ztechnology

Write a program to  determine final grade and indicate whether it is passing or failing. The final gradecalculated by the average of marks.

program:

#include<iostream>

using namespace std;

int main(){

int m1=10, m2=20, m3=30, m4=40, sum, avg;

sum=m1+m2+m3+m4;

avg=sum/4;

cout<<"avg is "<<avg;

if(avg<50)

cout<<"\n\nyou are failed";

else

cout<<"you are passed";

return 0;

}


WRITE A PROGRAM TO  CONVERT LENGTH IN FEET TO CENTIMETRE.

program:

#include<iostream>

using namespace std;

int main()

int LFT, cm;

cout<<"enter the length in feet: ";

cin>>LFT;

cm=LFT*30;

cout<<"the length in cm is "<<cm;

return 0;

}


GOTO NEXT PAGE




Previous Post Next Post