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 |
Write a C++ Program to find Square Root of a number using sqrt() function.
What do you by Function Overloading in C++?
0 Answers Akamai Technologies, Infogain,
Is there a difference between class and struct?
Can we provide one default constructor for our class?
How to convert integer to string in C++
What is a memory leak in C++?
What do you know about Volatile keyword in C++? Explain with an example code.
What are issues if we mix new and free in C++?
What does it mean to declare a member function as virtual in C++?
What is name mangling/name decoration?
What is the purpose of a constructor? Destructor?
Explain about Searching and sorting algorithms with complexities