Write a program to display the following output using a single cout statement
Maths=90
Physics=77
Chemistry = 69
Answers were Sorted based on User's Feedback
#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 |
#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 |
what do you mean by exception handling in C++?
Explain about Searching and sorting algorithms with complexities
What are the advantages/disadvantages of using inline and const?
What are the advantages and disadvantages of B-star trees over Binary trees?
Tell me about virtual function
What is a virtual function in C++?
Write a C++ program to print strings in reverse order.
Can we call C++ OOPS? and Why
Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.
It is possible to build a C++ compiler on top of a C compiler. How would you do this?
Explain why C++ is not purely Object Oriented Language
How does free know the size of memory to be deleted