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 placement new?
Explain function prototypes in C++.
What is the difference between member functions and static member functions?
How to stop class inheritance in C++ with condition that object creation should be allowed
Write a program to display the following output using a single cout statement Maths=90 Physics=77 Chemistry = 69
If class D is derived from a base class B
What are pass by value and pass by reference?what is the disadvantage of pass by value?
How do you write a function that can reverse a linked-list in C++?
Write a C++ Program to Reverse a Number using while loop.
Write a C++ Program to Find Sum and Average of n numbers using for loop.
How to invoke a C function using a C++ program?
Explain why C++ is not purely Object Oriented Language