Answer to Question #101263 in C++ for Madhur

Question #101263
WAP enter marks of three sujects and if sum is odd then print the sum otherwise print your school name
1
Expert's answer
2020-01-15T09:41:36-0500
#include<bits/stdc++.h>

using namespace std;

int main ()
{
  int m1, m2, m3;
  cout << "Enter subject marks: ";
  cin >> m1 >> m2 >> m3;
  int sum = m1 + m2 + m3;
  if (sum % 2 == 0)
    cout << "ABC Public School";    //enter your school name in quotes
  else
    cout<<sum;
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS