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
Describe delete operator?
What is algorithm in c++ programming?
Why do pointers exist?
Write a program to reverse a string using recursive function?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What is ostream in c++?
What are the advantages of c++?
Explain class invariant.
Why do we use oops?
What does return 0 do in c++?
What is the difference between passing by reference and passing a reference?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
What is the difference between the indirection operator and the address of oper-ator?
What is cout flush?
Is string part of stl?