The trouble is you think you have time. Your success depends on how you utilize your time.

C++ Program to find percentage of marks by taking marks as input

Write a C++ program which takes marks as input and gives percentage as output.

#include<iostream>
using namespace std;
int main()
{ cout<<"www.moznum.blogspot.com"<<endl<<endl;

float total_marks,obtained,percentage;
cout << "Enter the total marks: ";
cin >> total_marks;
cout << "Enter your obtained marks: ";
cin >> obtained;
percentage =
obtained/total_marks*100;
cout <<endl<< "U have obtained " << percentage << "% marks." <<endl;
return 0;
}

You can also search this topic by:

No comments:

Post a Comment