Write a C++ Program that solves the following expression: a * b / (-c * 31 % 13) *d; Assuming the values of variables are as fellows; a = 10, b = 20, c =15, d = 8

 


#include<iostream>

using namespace std;

int main()

{

int a,b,c,d,r;

a = 10;

b = 20;

c = 15;

d = 8;

r = a * b / (-c * 31 % 13) *d;

cout<<"Result of expression is :"<<r<<endl;

}

OUTPUT

Result of expression is :-160


No comments:

Post a Comment