• Language

    C

  • Description

    Sum of two numbers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    float a, b, sum;
    printf ("Enter the value of a: ");
    scanf ("%f", &a);
    (void) getchar ();
    printf ("Enter the value of b: ");
    scanf ("%f", &b);
    (void) getchar ();
    sum=a+b;
    printf ("Value of sum: %g\n", sum);
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}