UncleCoder.com

UncleCoder.com

Free programming examples and instructions

Add two numbers C

Code for adding two numbers in C programming

by Athil


Posted on 19 Jan 2017 Category: C Views: 1038

Edited on 18 Jul 2017


To add two integer numbes use the following code

Program

#include<stdio.h>

#include<conio.h>

void main()

{

         clrscr();

         int a,b,c;

         printf("Enter first number");

         scanf("%d",&a);

         printf("Enter second number");

         scanf("%d",&b);

         c= a+b;

         printf("Sum is %d",c);

         getch();

}

 



Leave a Comment:


Advertisement