In this program, int a,b,c statement declares 3 variables named as a,b & c . The 2 values
are entered by user because of scanf statement & stored in a & b . Now, c variable
stores the subtraction of a & b which is then displayed on screen using printf statement.
For more information & explanation of this program click here..
are entered by user because of scanf statement & stored in a & b . Now, c variable
stores the subtraction of a & b which is then displayed on screen using printf statement.
For more information & explanation of this program click here..
Programs to subtract two numbers.
#include<stdio.h>#include<conio.h>
void main()
{ int a,b,c;
clrscr();
printf("program to subtract 2 variables");
printf("\n enter value of a : ");
scanf("%d",&a);
printf(" enter value of b : ");
scanf("%d",&b);
c = a-b;
printf("after (a-b) ans = %d",c);
getch();
}

No comments:
Post a Comment
Guys if you think something is wrong or should be edit than please do comment.