How to make a marks obtained by a student
Subject
In this post I am discuss how to make a marks obtained by a student Five subjects are input through the users and find out the total marks and percentage obtained by the student print the total marks and percentage.Source Program:
In this program declare nine variable called English, Physics, Math, Chemistry, Urdu, Marks_Obtained, Total_Marks, Percentage and users enter the total marks as input and enter the subject marks as individual and the program calculate the marks obtained.
# include "iostream"
using namespace std;
void main ()
{
float English, Physics, Math, Chemistry, Urdu,
Marks_Obtained, Total_Marks, Percentage;
cout<<"The
TotalMarks is = ";
cin>>Total_Marks;
cout<<"Enter
marks of English is = ";
cin>>English;
cout<<"Enter
marks of Physics is = ";
cin>>Physics;
cout<<"Enter
marks of Math is = ";
cin>>Math;
cout<<"Enter
the marks of Chemistry is = ";
cin>>Chemistry;
cout<<"Enter
the marks of Urdu is = ";
cin>>Urdu;
Marks_Obtained = English + Physics + Math +
Chemistry + Urdu;
cout<<"The
Total MarksObtained is = "<<Marks_Obtained<<endl;
Percentage =
Marks_Obtained*100/Total_Marks;
cout<<"Percentage
is :"<<Percentage<<endl;
cout<<"Marksobtained
is :"<<Marks_Obtained<<endl<<"TotalMarks is :"<<Total_Marks<<endl<<"Percentage is :"<<Percentage<<endl<<endl;
}
OUTPUT:
The Output should look like this
The TotalMarks is = 500
Enter marks of English is =
87
Enter marks of Physics is =
87
Enter marks of Math is = 87
Enter the marks of Chemistry
is = 87
Enter the marks of Urdu is =
89
The Total MarksObtained is =
437
Percentage is :87.4
Marksobtained is :437
TotalMarks is :500
Percentage is :87.4
Press any key to continue .
. .
Object:
In this post I am discuss how to write a c++ program that takes any integer “n” as input and generate Its multiplication take kept to (using for loop) the range is five.
Source Program:
Object:
In this post I am discuss how to write a c++ program that takes any integer “n” as input and generate Its multiplication take kept to (using for loop) the range is five.
Source Program:
In this program declare variable called n and user enter the integer value and the program generate the table.
#include "iostream"
using namespace std;
void main()
{
int n;
cout<<"Enter The
Number = ";
cin>>n;
for( int i = 1 ; i <= 5 ; i++ )
{
cout<<n<<"
* "<<i<<" = "<<n*i<<endl;
}
}
OUTPUT:
The Output should look like this
Enter The Number = 5
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
Press any key to continue . . .
Subject
In this post I am discuss how to write a c++ program that asks the user to an integer ‘n’ and the program then calculate and display its factorial (N!).
Source Program
Subject
In this post I am discuss how to write a c++ program that asks the user to an integer ‘n’ and the program then calculate and display its factorial (N!).
Source Program
In this program declare variable n, ans, and user enter the any number as integer and program calculate the factorial for that number.
Formula:
ans*=i;
#include "iostream"
using namespace std;
void main()
{
int n ,
ans=1;
cout<<" Enter Any Number
= ";
cin>>n;
for( int
i=1 ; i <= n ; i++ )
{
ans*=i;
}
cout<<ans<<endl;
}
Output:
The Output should look like this
Enter Any Number = 5
120
Press any key to continue . . .