Write a program that inputs an even and odd number through keyboard, multiples even with 5 and odd with 3 and odds both results. It subtracts the result from 1000 and finally prints the difference.

#include<iostream>

using namespace std;

int main()

{

int even, odd, r;

cout<<"Enter an even number: ";

cin>>even;

cout<<"Enter an odd number: ";

cin>>odd;

r = 1000-((even*5) +(odd*3));

cout<<"Difference = "<<r;

}

OUTPUT

Enter an even number: 10

Enter an odd number: 5

Difference = 935


1 comment: