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 are Agilent PRECOMPILERS?
What is a virtual function in C++?
What is Boyce Codd Normal form?
What is placement new?
How does stack look in function calls? When does stack overflow? What can you do to remedy it?
What is data abstraction? How is it implemented in C++?
Consider the following C++ program
How to input string in C++
What does it mean to declare a member function as virtual in C++?
What is a class in C++?
0 Answers Amazon, TCS, UGC Corporation,
What are the advantages/disadvantages of using inline and const?
It is possible to build a C++ compiler on top of a C compiler. How would you do this?