Testing.

Wednesday, 28 December 2016

C programming language: C program to subtract two numbers (Mathematics operation).

//Normal program
#include<stdio.h>
#include<conio.h>
void main()
{
int a=20,b=10;
printf("%d",a-b);
getch();
}

output:- 10

//Ask number from user to Subtract
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("Enter No to subtract: ");
scanf("%d %d",&a,&b);
c=a-b;
printf("Subtraction= %d",c);
getch();
}





No comments:

Post a Comment