Find out summation of two numbers using user input.


Find out summation of two numbers using user input.

Theory : First you have to declare two variables  ,and take two input by scanf .Again you have to declare a variable name sum and summation two variables in this variable .After doing this print the sum variable.

code: 
          #include<stdio.h>
int main()
{

    int num1,num2,sum;

    printf("Enter the value of first number:");
    scanf("%d",&num1);
    printf("Enter the value of second number:");
    scanf("%d",&num2);

    sum=num1+num2;

    printf("Summation of two number is =%d",sum);
    return 0;

}



No comments

Powered by Blogger.