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 |
If class D is derived from a base class B
What are issues if we mix new and free in C++?
What is the difference between virtual functions and pure virtual functions?
What are Agilent PRECOMPILERS?
What is bool in C++
What are the advantages and disadvantages of B-star trees over Binary trees?
Explain the FOR loop with a help of a code.
Write a C++ Program to Find Sum and Average of three numbers.
What is C++11?
What are string library functions(syntax).
What are the fundamental features of an object-oriented language?
What is the purpose of a constructor? Destructor?