C Program For Addition Table Using For Loop. Finding the addition table of a given number using for loop in C programming. If you are looking for a C program to find addition table example, this C programming tutorial will help you to learn how to write a program for addition table in C. Just go through this C programming example to learn about printing addition of a number.
C Program For Addition Table
Learn how to write a c Program to Display addition table of a number. Writing addition table program in C can be done using various techniques but here in this program, we show how to write a c addition table program using for loop in a proper way. Happy coding.
C Program For Addition Table Using For Loop – Source Code
You can copy paste the below C Program For Addition Table Using While Loop, in c compiler to check how the source code work. Or write your own addition table C Program with the help of this below c programming tutorial.
Source Code:
/* C PROGRAM FOR ADDITION TABLE - ADDITIONTABLE.C */ #include<stdio.h> #include<conio.h> void main() { int i, t, n ; //variable declaration clrscr() ; printf("Enter the table : ") ; scanf("%d", &t) ; //reading input from user printf("\nEnter the limit : ") ; scanf("%d", &n) ; //reading the limit of the table printf("\nThe table is :\n\n") ; //c program logic for addition table using for loop for(i = 1 ; i <= n ; i++) printf("%4d + %4d = %4d\n", i, t, i + t) ; getch() ; }
C Program For Addition Table – OUTPUT
After you compile and run the above c program for addition table, your C compiler asks you to enter the number to print the addition table. After you enter a number, the program will be executed and give output.
Output:
Enter the table : 5
Enter the limit : 15
The table is :
1 + 5 = 6
2 + 5 = 7
3 + 5 = 8
4 + 5 = 9
5 + 5 = 10
6 + 5 = 11
7 + 5 = 12
8 + 5 = 13
9 + 5 = 14
10 + 5 = 15
C PROGRAMMING TUTORIALS
- Denomination Program in C
- C Program to Print Multiplication Table
- C Program Array with Example
- Binary Search in C Program Using Recursion
- Bubble Sort in C Using Pointers
- Bubble Sort Program in C Using Recursion
- Bubble Sort Program in C Using Array
- Bubble Sort Program in C Using Function
- Bubble Sort Program in C Using Linked List
- Stack Push Pop Program in C Using Arrays
- Factorial Program in C Using Pointers
- Factorial Program in C Using While Loop
- C Program For Factorial Using For Loop
- Factorial Program in C Using Recursion Function
- C Program To Reverse a String Using Pointers
- C Program To Swap Two Numbers Using Two Variables
- C Program To Swap Two Numbers Using Three Variables
- C Program For Prime Numbers – Check a Number is Prime or Not
- C Program To Reverse a String with Using Function
- C Program to Reverse a String without Using Function