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


Please Help Members By Posting Answers For Below Questions

Why do we need oop?

656


Which is most difficult programming language?

574


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

1802


What is a c++ object?

611


How do you master coding?

558






What is a class template?

583


What is the problem with multiple inheritance?

578


Which language is pure oop?

545


What is the difference between a baller and a reference in C++?

569


What are the benefits of polymorphism?

612


What is public, protected, private in c++?

642


How stl is different from the c++ standard library?

633


What does and I oop and sksksk mean?

643


Is c++ a difficult language?

567


What is basic if statement syntax?

559