Answer to Question #180355 in C++ for Tengku

Question #180355

write a c++ statement as following :


a. Declare int variable num1 and num2.

b. Prompt the user to input two numbers

c. Input the first number in num1 and the second number in num2.

d. Output num1, num2, and 2 times num1 minus num2. Your output must identify each

number and the expression

e. Declare a double named salary

f. Assign 15 to x and y

g. Input the user’s age

h. Initialize total to 0

i. Declare a variable named address to store 15 characters.

j. Declare a constant as float and assign it to 0.125

Statement in C++

 k. Declare three variables as integer. Initial the first variable to 10.

l. Declare 5 variables, whereby the first three variables are float and the last two

variables are integer



1
Expert's answer
2021-04-11T15:53:03-0400
#include <iostream>
using namespace std;
int main()
{
    int num1, num2;
    cout<< "Enter num1 and num2: ";
    cin>> num1>>num2;
    cout<< "Num1 = " << num1 << " and Num2 = " << num2 << endl;
    cout << "num1-num2 = " << num1-num2 <<"num1-num2 = " << num1-num2 << endl;
    double salary;
    int x=15;
    int y=x;
    cout << "Input your age" << endl;
    char address[15]; 
    const float gg=0.125;
    int firts=10, second, third;
    float a1,a2,a3;
    int a4,a5;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS