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 does it mean to take the address of a reference?
How to delete array of objects in C++? Proof by C++ code for proper deletion
C++ Public access specifier instead of Private – What is bad ?
What is Boyce Codd Normal form?
What are Agilent PRECOMPILERS?
Write a program that can take input from 3 to 8 and calculate the average?
Write a program to read two numbers from the keyboard and display the larger value on the screen
Difference between Call by pointer and by reference.
Define type casting in C++.
What is RTTI and why do you need it?
How to input string in C++
What is static variable and difference between(const char *p,char const *p,const char* const p).