You are on page 1of 2

1.

Convert the following formula into an arithmetic expression:

a) ans=ax2 + bx + c
b) p=4x+(7−z)−6y
𝒓 𝒏𝒕
c) 𝑨 = 𝑷 (𝟏 + 𝒏)
d) W = F̅Δs cos θ
−𝒃+√𝒃𝟐 −𝟒𝒂𝒄
e) 𝒙=
𝟐𝒂

2. State the rules used for naming the variable.

3. Write C++ statement to do the following:

a) Increment the value of variable named annualSalary by 20%


b) Declare variable named horsePower and assign an initial value of 30.45 to it.
c) Assign a value of ‘Y’ to a variable named response
d) Decrease a value of variable ind by 1.
e) Assign the value of num1 to the power of 6 to num2.

4. Given the following program, What is the output of the program if the input is 158?

using namespace std; c=lo/10;


int main() lo=lo%10;
{ d=lo/5;
int e=lo%5;
dol,lo,a,b,c,d,e,f; cout<<”AAAA”<<a<<endl;
cout<<”Enter the cout<<”BBBB”<<a<<endl;
amount of dollar”; cout<<”CCCC”<<a<<endl;
cin>>dol; cout<<”DDDD”<<a<<endl;
a=dol/50; cout<<”EEEE”<<a<<endl;
lo=dol%50; return 0;
b=lo/20;
lo=lo%20; }

You might also like