answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

int main(void)

{

int sum=0,n,i;

clrscr();

printf("\n Enter two no.");

scanf("%d%d",&n,&i);

sum=n+i;

printf("\n%d+%d=%d,n,i,sum);

getch();

return 0;

}

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
BeauBeau
You're doing better than you think!
Chat with Beau
More answers

#include

#include

void main()

{

int a,b,c;

clrscr();

printf("enter a ,b values:");

scanf("%d%d",&a,&b);
c=a+b;

printf("the addition of two no is:",c);

getch();

}

User Avatar

Wiki User

15y ago
User Avatar

//write a program for subtraction of 2 numbers.

#include

main()

{

int a,b,d;

printf("enter 2 numbers :");

scanf("%d%d",&a&b);

d=a-b;

printf("subtraction of 2 numbers=%d",d);

}

output(example)-

enter 2 numbers : 3 2

subtraction of 2 numbers : 1

User Avatar

Wiki User

15y ago
User Avatar

#include<stdio.h>

#include<conio.>

void main()

{

int a,b,sum;

clrscr();

cin<<"enter value of a";

cout>>a;

cin<<"enter value of b";

cout<<b;

sum=a+b;

cout<<"sum of two numbers="

getch();

}

User Avatar

Wiki User

15y ago
User Avatar

//program to add two numbers

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

clrscr(): //its prototype or header file is conio.h

printf("\n enter first number :"); //its prototype or header file is stdio.h

scanf("%d",&a); //its prototype or header file is stdio.h

printf("\n enter second number :"); //its prototype or header file is stdio.h

scanf("%d",&b); //its prototype or header file is stdio.h

c=a+b;

printf("\n the sum of two numbers is :%d",c); //its prototype or header file is stdio.h

getch(); //its prototype or header file is conio.h

}

User Avatar

Wiki User

11y ago
User Avatar

Just declare, initialize, and subtract...

double a = 1.23456789;

double b = 2.34567890;

double c;

c = a-b;

User Avatar

Wiki User

14y ago
User Avatar
User Avatar

Yazie Bekalu

Lvl 1
2y ago
Tank you

Use ~ Ones complement operator and add one.

10 - 3 = 7

10 + ~3 + 1 = 7

GP>

User Avatar

Wiki User

16y ago
User Avatar

int num0 = 0;

int num1 = 1;

int num2 = num1 - num0;

User Avatar

Wiki User

16y ago
User Avatar

wap to subtract two variables

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program in c language to subtract two numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp