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

Is java based off c++?

613


Why multiple inheritance is not allowed?

684


What are member functions used in c++?

657


Does c++ have foreach?

624


Can we sort map in c++?

685






give me an example for testing a program showing the test path .show how the test is important and complex.

2533


What does the linker do?

690


What does new return if there is insufficient memory to make your new object?

682


A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

3335


What is polymorphism and its types?

691


What is c++ prototype?

679


Is there any function that can skip certain number of characters present in the input stream?

667


Is c++ proprietary?

665


What are manipulators used for?

708


Explain the difference between method overriding and method overloading in C++?

625