Question #101263

WAP enter marks of three sujects and if sum is odd then print the sum otherwise print your school name

Expert's answer

#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;
}
LATEST TUTORIALS
APPROVED BY CLIENTS