C Programming
- Print integer
- Add & subtract
- Odd & even
- Multiply & divide
- Check vowels
- Letter grade program
- Leap year program
- Sum of digits
- Prime numbers
- Sum of numbers
- Find factorial
- Fibonacci series
- Fibonacci triangle
- Number triangle
- Alphabet triangle
- Armstrong numbers
- Palindrome numbers
- Swap number
- Reverse number
- Decimal to binary
- Assembly code in C
- Matrix multiplication
- HCF & LCM
- nCr & nPr
- Print pattern
- Floyd’s triangle
- Pascal triangle
- Count digits
- Strong numbers
- Perfect numbers
- Sum of natural number
- Binary to decimal
- Decimal to octal
- Octal to decimal
- Binary to octal
- Octal to binary
- Add using pointer
- Bubble sort
- Insertion sort
- Selection sort
- Quick sort
- Binary search
- Linear search
- Largest element of array
- Smallest element of array
- Reverse Array
- Variable size & limit
- ASCII value of character
- Sum of array elements
- Number of element in array
- Merge two array
- Insert element in array
- Delete element from array
- Add two matrix
- Transpose matrix
- Print string
- Reverse string
- Delete vowels
- Sort string
- Remove spaces
- Swap string
- Random numbers
- Print date & time
- Print IP address
- Shut down computer
How to print an integer in C?
In this C programming article we will learn to print integer in different way. We can print an integer using printf(). We will take the input from user using scanf() and then we can print that int by printf() in C programming.
C program to print integer
#include <stdio.h>
int main(){
int x; // variable declaration
printf("Enter an integer here : ");
scanf("%d", &x); // taking input and store it to integer x
printf("\nYou have entered the integer %d\n", x); // printing integer
return 0;
}
Output of this print integer program

Print integer using loop in C
#include <stdio.h>
int main(){
int i; // variable declaration
for (i = 1; i <= 100; i++)
printf("%d ", i); // printing integers
return 0;
}
Output of this C program

C program to store an integer in a string and print
#include <stdio.h>
int main (){
char numbers[1000];
printf("Input a large integer here : ");
scanf("%s", numbers); // taking string inpute
printf("\nYou have entered the integer = %s\n", numbers); // printing
return 0;
}
See the output

You can print any integer using other methods too. So, try to write a program in your own.
Previous page:Â C programming
Next page:Â Add and subtract