Write a program to display the following output using a single cout statement
Maths=90
Physics=77
Chemistry = 69
Answer Posted / hr
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
char *sub[]={"Maths","Physics","Chemestry"};
int mark[]={90,77,69};
for(int i=0;i<3;i++)
{
cout<<setw(10)<<sub[i]<<setw(3)<<"="<<setw(4)<<mark[i]<<endl;
}
return 0;
}
Output:
Maths=90
Physics=77
Chemistry=69
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When should we use container classes instead of arrays?
What is c++ prototype?
What do you mean by const correctness?
What is a binary file? List the merits and demerits of the binary file usagein C++.
Differentiate between an external iterator and an internal iterator?
What is recursion?
Why do while loop is used?
When should you use global variables?
What are activex and ole?
What is the use of object in c++?
What is abstract class in c++?
Get me an image implementation program.
Is c++ still in demand?
What is the latest c++ version?
What are the two types of comments, and how do they differ?