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 best c++ ide?
Explain how the virtual base class is different from the conventional base classes of the opps.
How do you print a string on the printer?
What does I oop mean?
What is the difference between #import and #include?
Mention the storage classes in c++.
Can manipulators fall in love?
How does a C++ structure differ from a C++ class?
What is destructor example?
What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor
write knight tour problem which is present in datastructure
Why is c++ still best?
What is problem with overriding functions?
Why is c++ not purely object oriented?
What is polymorphism and why is it important?