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

What are guid?

939


what do you mean by exception handling in C++?

788


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2973


Which is better struts or spring?

798


What does namespace mean in c++?

822


what are Operators and explain with an example?

925


What is the stl, standard template library?

818


Why do we use class in oops?

740


What is the first name of c++?

762


What is function overloading c++?

775


Do vectors start at 0?

756


How do you master coding?

802


What is difference between oop and pop?

847


Search for: what is pair in c++?

863


Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?

778