Computer Science, asked by QueenSaanvi, 3 months ago

c++ Question -

WAP that accepts two numbers from the user and print sum.

Computer master please answer it

Answers

Answered by IlMYSTERIOUSIl
11

Question

Write a program that accepts two numbers from the user and print sum.

Program

#include<iostream.h>

#include<conio.h>

void main()

{

int a=0,b=0,c=0;

clrscr();

cout<<” ENTER THE VALUE OF a”;

cin>>a;

cout<<” ENTER THE VALUE OF b”;

cin>>b;

c=a+b;

cout<<”the sum of a & b is”<<c;

getch();

}

\rule{300}{2}

Output

ENTER THE VALUE OF a__

ENTER THE VALUE OF b__

the sum of a & b is___

\rule{300}{2}

Example

if I have entered the value of a as 45 and the value of b as 34 then the sum of a and b will be 79

ENTER THE VALUE OF a 45

ENTER THE VALUE OF b 34

the sum of a & b is 79

Attachments:
Similar questions