Computer Science, asked by subhashbharathi123, 10 months ago

write c++ statement for the following
1. declare a variable to store 1009.87
2. declare a variable mail to store @.
3. declare a constant y to store 44.
4. accept a number from the user in the variable balance
5. display the output of variable balance

Answers

Answered by suskumari135
43

c++ statement

Explanation:

1. declare a variable n1 to store 1009.87

float n1=1009.87;  

2. declare a variable mail to store @.

string mail="@";

3. declare a constant y to store 44.

const int y = 44;

4. accept a number from the user in the variable balance .

int balance;      

cin>>balance;

5. display the output of variable balance.

cout<<balance;

C++ program

#include <iostream>

using namespace std;

int main()

{

   int balance;

   float n1=1009.87;  

   string mail="@";

   const int y = 44;

   cin>>balance;

   cout<<balance;

   return 0;

}

Output

45

45

Answered by pallavibhavani2
13

Answer:

B. write c++ statement for the following.

1. declare a variable to store 1009.87

  • float n1=1009.87;

2. declare a variable mail to store @.

  • string mail="a";

3. declare a constant y to store 44.

  • const int y=44

4. accept a number from the user in the variable balance

  • int balance;
  • cin<< balance;

5. display the output of variable balance

  • cout<<balance;

Similar questions