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 ? | 1 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 |
How does stack look in function calls? When does stack overflow? What can you do to remedy it?
What is C++11?
What Is A Default Constructor in C++ ?
What kind of problems does name mangling cause?
Define type casting in C++.
To solve the 8 Queens problem, which algorithm is used?
Write a C++ Program to find Addition of Two Numbers.
What does it mean to take the address of a reference?
How can a C function be called in a C++ program?
C++ Public access specifier instead of Private – What is bad ?
How do you write a function that can reverse a linked-list in C++?
Explain encapsulation in C++.