Sunday, 5 December 2021

subtraction of 2 variables

 #include<stdio.h>  


int main()        
{
    int a;      
    int b;

    printf("enter the first number a\n");
    scanf("%d", &a);

    printf("enter the second number b\n");
    scanf("%d", &b);

    printf("the answer is %d\n", a-b);    
    return 0;

}
// project:_3 (substraction)
#include <stdio.h>
int main ()
{
    int a,b,c,d;
    printf ("enter the first number: ");
    scanf ("%d", &a);

    printf ("enter the second number: ");
    scanf ("%d", &b);
    printf ("the first result is:%d\n",a-b);
    // jab bhi result print karana ho then scanf use nhi karte.
    // because scanf ka  use user se input lene ko karte he.

    printf ("enter the third number: ");
    scanf ("%d", &c);

    printf ("enter the fourth number: ");
    scanf ("%d", &d);
    printf ("the second result is:%d\n",c-d);
    // result print karate time result epression ke sath,
    // corresponding data type symbol ka bhi use use karne parhi programme
execute hoga.

    printf ("the ultimate result is:%d\n",(a-b)-(c-d));
   
    return 0;
}
output:_
enter the first number: 50 enter the second number: 40 the first result is:10 enter the third number: 60 enter the fourth number: 30 the second result is:30 the ultimate result is:-20

No comments:

Post a Comment

here we are to help you.you can watch videos and get information about :- (1) scientific facts (2) education (3) gaming (4) music (5) lyrics (6) cartoons and many more.So keep watching keep learning, thank you.

Recurtions

  //Why are recursions? //We can solve difficult long iteratively can be solved simply recursively. // there are some problems which suite...