Computer Science, asked by sumit0790choudhary, 1 year ago

write a program to generate the following output: 5 10 9 assign value 5 to variable using assignment operator (=)multiply it by 210 and subtract 12 generate 9​

Answers

Answered by lovingheart
24

A program to generate the given output:

#include <iostream.h>

void main()

{

int a = 5;  

int b = a*2;  

int c = b-1;  

cout << a << "\n" << b << "\n" << c; // Print the output

return 0;

}

According to the given instruction 5 is assigned to a variable ‘a’, and then to get the value of 10, we need to multiply a with 2 and it is stored in variable ‘b’. Finally to get 9, the value of ‘b’ is subtracted by 1 and stored in the variable ‘c’. The value of a,b,c are printed using cout statement.

Answered by yashsehara720
0

Answer:

please give me my answer

Similar questions