You are on page 1of 10

ASSIGNMENT#04

NATIONAL UNIVERSITY OF TECNOLOGY ISLAMABAD


ME1016 –Computer programming for Engineering Applications

NAME ID DEPARTMENT
ARSLAN AFZAL F18602037 MECHANICAL

(Question 1)
Ouput:

(Question 2)

Output:
(Question 3)

Output:
(Question 5)
A) (i)

#include <iostream>
using namespace std;
int main(){int x=7 + 3 * 6 / 2 - 1;

cout << x;
}

Output:

B (ii)

#include <iostream>
using namespace std;
int main()
{int x= 2 % 2 + 2 * 2 - 2 / 2;

cout << x;
}

Output:
Q5

C PART (iii)

#include <iostream>
using namespace std;
int main()
{int x= (3 * 9 * (3 + (9 * 3 / (3))));

cout << x;
}

(Question 6)
Output:

(Question 7)
Output:
Q4-

#include <iostream>
using namespace std;
2 + 5 = 7 int main()
{
X=7
int x;
x = 2 + 5;
cout << "x="<<x<<endl;
}
#include <iostream>
using namespace std;
int main()
13 + 89 = 102 {
int x; X=102
x = 13 + 89;
cout << "x="<<x<<endl;
}
#include <iostream>
using namespace std;
int main()
{
X=14
34 - 20 = 14
int x;
x = 34 - 20;
cout << "x="<<x<<endl;
}
#include <iostream>
using namespace std;
int main()
45 - 90 = -45 {
int x; X=-45
x = 45 - 90;
cout << "x="<<x<<endl;
}
#include <iostream>
using namespace std;
int main()
2 * 7 = 14 {
int x;
X=14
x = 2 * 7;
cout << "x= " << x << endl;
}
#include <iostream>
using namespace std;
int main()
5 / 2 = 1 {
float x; X=1
x = 5 / 2;
cout << "x= " << x <<
endl;
}
#include <iostream>
using namespace std;
int main()
34 % 5 = 4 {
int x;
x = 34 % 5; X=4
cout << "x= " << x << endl;
}
#include <iostream>
using namespace std;

4 % 6 = 4
int main()
{
X=4
int x;
x = 4 % 6;
cout << "x= " << x << endl;
}

You might also like