How to add to integers in C programming

 #include<stdio.h>

int main(int argc, char *argv[])

{

    int a, b;

    printf("Enter number a\n");

    scanf("%d", &a);

    printf("Enter number b\n");

    scanf("%d", &b);


    printf("The sum is %d\n", a+b);


    return 0;

}


Now give two integers as user input and press "Enter" and check the results.


If you have any doubt comment down below.

Comments

Post a Comment

Popular posts from this blog

C program to find the greatest of three numbers with user input.

Check whether a character Vowel or Consonant