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
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
What is the real purpose of class – to export data?
Why do we need function?
Is c++ vector dynamic?
Why do we use the using declaration?
Can a class be static in c++?
What is the main use of c++?
Which is not an object oriented programming language?
Why polymorphism is used in oops?
Is map thread safe c++?
Write a C++ Program to check whether a number is prime number or not?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
How many namespaces are there in c++?
How do you differentiate between overloading the prefix and postfix increments?
What is Destructor in C++?