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 is the difference between virtual functions and pure virtual functions?
How will you execute a stack using a priority queue? (Push and pop should be in O (1)).
What does it mean to declare a function or variable as static?
Name the operators that cannot be overloaded.
What do you by Function Overloading in C++?
0 Answers Akamai Technologies, Infogain,
It is possible to build a C++ compiler on top of a C compiler. How would you do this?
What Are The Differences Between A C++ Struct And C++ Class?
There is a base class sub, with a member function fnsub(). There are two classes super1 and super2 which are sub classes of the base class sub.if and pointer object is created of the class sub which points to any of the two classes super1 and super2, if fnsub() is called which one will be inoked?
Write a program that ask for user input from 5 to 9 then calculate the average
What is conversion constructor in C++
Can we use THIS Pointer in static function – Reason in C++?
Tell us the size of a float variable.