Showing posts with label compute the sum. Show all posts
Showing posts with label compute the sum. Show all posts

C Language | Addition part 1

Wednesday, 5 December 2012

Wherever we went we always encounter math, either when you're at home, in school or even in the market. Most of time, basic mathematics is always useful like addition and subtraction. Before, adding or subtracting is used with beads or stones or whatever things that might represent the figure all of it can be useful. Then, new generation has come and calculators were born. Today, computers are used. So, I thought of making a program that can add numbers just like a calculator using C language.

The program is designed to add two (2) numbers/integers using the basic mathematics and C language commands. Check out the codes below.



     #include<stdio.h>
     #include<conio.h>
     
     int main()
    {
     int a,b,c;
     
     printf("Enter number: ");
     scanf("%d", &a);
     
     printf("\nEnter number: ");
     scanf("%d", &b);
    
     c = a + b;
    
     printf("\nThe sum is %d", c);
     getch();
     }
Related Posts Plugin for WordPress, Blogger...