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 |
Can we provide one default constructor for our class?
Can we use THIS Pointer in static function – Reason in C++?
What are the advantages and disadvantages of B-star trees over Binary trees?
What are the fundamental features of an object-oriented language?
what do you mean by exception handling in C++?
Identify the error in the following program. include<iostream> using namespace std; void main() { int num[]={1,2,3,4,5,6}; num[1]==[1]num ? cout<<"Success" : cout<<"Error"; }
What does it mean to take the address of a reference?
What is RTTI and why do you need it?
Explain the difference between C and C++.
Write a program to display the following output using a single cout statement Maths=90 Physics=77 Chemistry = 69
Difference between function overloading and function overriding.
Explain encapsulation in C++.