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 ? | 1 Yes | 0 No |
Post New Answer View All Answers
Which ide is best for c++?
What is an example of genetic polymorphism?
How can you force the compiler to not generate them?
What is #include iostream?
What is copy constructor? Can we make copy constructor private in c++?
Tell me difference between constant pointer and pointer to a constant.
What is solid in oops?
what type of questions
What do you mean by friend class & friend function in c++?
What is a multiset c++?
What is the benefit of encapsulation?
What kind of problems can be solved by a namespace?
What is a unnitialised pointer?
Explain the virtual inheritance in c++.
What are multiple inheritances (virtual inheritance)?