
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
C Program to Add two Integers
A program to add two numbers takes to numbers and does their mathematical sum and gives it to another variable that stores its sum.
Example Code
#include <stdio.h> int main(void) { int a = 545; int b = 123; printf("The first number is %d and the second number is %d
", a , b); int sum = a + b; printf("The sum of two numbers is %d" , sum); return 0; }
Output
The first number is 545 and the second number is 123 The sum of two numbers is 668
- Related Articles
- Java program to add two integers
- C++ Program to Add Two Numbers
- C Program to add two fractions
- C# Program to Add Two TimeSpan
- C# program to add two matrices
- Java program to swap two integers
- C# program to accept two integers and return the remainder
- Program to add two binary strings in C++
- Program to Add Two Complex Numbers in C
- Java Program to add integers and check for overflow
- How to sum two integers without using arithmetic operators in C/C++ Program?
- Java Program to add long integers and check for overflow
- C++ program to overload addition operator to add two matrices
- C++ Program to Add Two Matrix Using Multi-dimensional Arrays
- Write a program to add two complex numbers using C

Advertisements