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

When should we use container classes instead of arrays?

586


What is c++ prototype?

591


What do you mean by const correctness?

631


What is a binary file? List the merits and demerits of the binary file usagein C++.

732


Differentiate between an external iterator and an internal iterator?

572






What is recursion?

663


Why do while loop is used?

579


When should you use global variables?

630


What are activex and ole?

547


What is the use of object in c++?

573


What is abstract class in c++?

592


Get me an image implementation program.

1562


Is c++ still in demand?

639


What is the latest c++ version?

612


What are the two types of comments, and how do they differ?

576