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
Which is most difficult programming language?
What are c++ manipulators?
What are the three forms of cin.get() and what are their differences?
What is the basic concept of c++?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
Can we provide one default constructor for our class?
Difference between pointer to constant and constant pointer to a constant. Give example.
What language does google use?
Is c++ a programming language?
Are c and c++ similar?
What are the advantages of prototyping?
Which compiler does turbo c++ use?
What are properties in oop?
Differentiate between a copy constructor and an overloaded assignment operator.
What is a virtual destructor? Explain the use of it?