Thursday, 8 May 2014

Write a program to display the following output using a single cout statement. Subject Marks Mathematics 90 Computer 77 Chemistry 69

2 comments
2-) Write a program to display the following output using a single cout statement.  
   Subject            Marks
   Mathematics     90
   Computer         77
   Chemistry        69

Solution:-


#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
    int sub1,sub2,sub3;
    cout<<"Enter Mathematics marks = ";
    cin>>sub1;
    cout<<"Enter Computer marks = ";
    cin>>sub2;
    cout<<"Enter Chemistry marks = ";
    cin>>sub3;
    cout<<"\nSubject\t\t\tMarks\n";
    cout<<"\nMathematics\t\t"<<sub1;
    cout<<"\nComputer\t\t"<<sub2;
    cout<<"\nChemistry\t\t"<<sub3;
    getch();
}
If You Enjoyed This, Take 5 Seconds To Share It

2 Questions:

Ahmad said...

this is rong type of code

Best of collection said...

the code is wrong.