Add Two Numbers In C Taking input from user - Math Traders

Latest

Add Two Numbers In C Taking input from user

Hello friends in this tutorial i shall tell you how that how you take input from the user in c programming language and add two numbers by taking input from the user in c.

To take input form the user we use a function called "scanf()" in c. Now lets see how we use "Scanf()" into a c program to take an input from the user.

so lets begin.


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,sum=0;
    printf("Please enter two integers\n");
    scanf("%d%d",&a,&b);
    sum=a+b;
    printf("sum of numbers is:%d\t",sum);
    return 0;
}

No comments:

Post a Comment