Learning stage | c++ programs

 #include <iostream>

using namespace std;
int main() 
{
/*//Program to calculate the discount percentage of acutal cost as well as actuall price.
int price = 90000;
int discount_percentage = (90000/100)*7;
int discounted_price= 90000-discount_percentage;
cout <<discounted_price;
 return 0;*/

 // Q- Priya wants to write a program to input marks in three subjects out of 100 and 
// calculate and display teh total  marks and percentage . How should she do this task ?
    
    int  ganit,science , social;
    cout<<"Enter the marks of math : ";
    cout<<endl;
    cin>>ganit;
    cout<<endl;
    
    cout<<"Enter the marks of science : ";
    cout<<endl;
    cin>>science;
    cout<<endl;
   
   
    cout<<"Enter the marks of social : ";
     cout<<endl;
    cin>>social;
     cout<<endl;

     cout<<"the percentage of the given marks is: ";
     cout<<endl;
     int ganit_percentage = (100/100)*ganit;
     int science_percentage = (100/100)*science;
     int social_percentage = (100/100)*social;
    
     cout<<"Math " <<ganit_percentage<<"%";
cout<<endl;
     cout<<"Science " <<science_percentage<<"%";
   cout<<endl;  
     cout<<"social " <<social_percentage<<"%";
cout<<endl;


}    

Comments

Popular posts from this blog

swapping the alternate values in given array's element ! 17/11/2022

c++ basic question