एक C++ का प्रोग्राम लिखिए, जिसमें 5 परीक्षार्थियों की उम्र और ग्रेड इनपुट किए जाते हैं। यदि छात्रों की उम्र 20 वर्ष से अधिक हो और ग्रेड ‘B’ हो, उनकी उम्र व ग्रेड प्रिण्ट करें।
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
#include
void main( )
{
int age [5], i;
char grade [6];
for (i=0; i<5; i++)
cout<<“Enter age and grade of student”<<i+1<<“:”; cin>>age[i]>>grade [i];
}
for (i=0; i<5; i++) { if ( (age [1]>=20) && (grade[i]==’B’))
{
cout<<“\n age=”< }
}
}
आउटपुट
Enter age and grade of student 1: 25 A
Enter age and grade of student 2:25 B
Enter age and grade of student 3:33 A
Enter age and grade of student 4:24 A
Enter age and grade of student 5:12 A
age = 25 grade = B