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
What is the use of c++ programming language in real life?
What is recursion?
Define stl.
What is an adaptor class or wrapper class in c++?
Mention the purpose of istream class?
How to generate random numbers in C++ with a range?
How do you compile the source code with your compiler?
explain sub-type and sub class? atleast u have differ it into 4 points?
Why do we use double in c++?
What methods can be overridden in java?
What is the best c++ compiler for windows 10?
What is pointer to member?
What are features of c++?
What do stl stand for?
What is c++ redistributable?