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


Please Help Members By Posting Answers For Below Questions

What is the use of c++ programming language in real life?

777


What is recursion?

1229


Define stl.

1027


What is an adaptor class or wrapper class in c++?

808


Mention the purpose of istream class?

826


How to generate random numbers in C++ with a range?

631


How do you compile the source code with your compiler?

802


explain sub-type and sub class? atleast u have differ it into 4 points?

2039


Why do we use double in c++?

806


What methods can be overridden in java?

932


What is the best c++ compiler for windows 10?

771


What is pointer to member?

774


What are features of c++?

830


What do stl stand for?

863


What is c++ redistributable?

867