## C Program to find the Sum of First n Natural numbers

Program to find the sum of first n natural numbers. We will see two C programs to calculate the sum of natural numbers. In the first C program we are using for loop for find the sum and in the second program we are doing the same using while loop.To understand these programs, you should […]

## C Program to check Leap Year

his program checks whether the input year is leap year or not. Example: Program to check Leap Year You can check whether a year is leap or not by using this mathematical logic:Leap Year:If a year is divisible by 4, 100 and 400 then it is a leap year.If a year is divisible by 4 […]

## C Program to Check whether an Alphabet is Vowel or Consonant

This program checks whether the input character is vowel or consonant. Example: Program to check Vowel or Consonant This program takes the character value(entered by user) as input and checks whether that character is a vowel or consonant using if-else statement. Since a user is allowed to enter an alphabet in lowercase and uppercase, the […]

## C Program to find the Size of int, float, double and char

This program finds the size of data types such as char, int, float, double. Example: Program to find the size of data types in C In this program, we are using the sizeof() operator to find the size of data types. When the sizeof is used with the primitive data types such as int, float, […]

## C Program to Find ASCII value of a Character

ASCII value represents the English characters as numbers, each letter is assigned a number from 0 to 127. For example, the ASCII value for uppercase Q is 81. Example 1: Program to display ASCII value of a character entered by user This program takes the character entered by user and displays the ASCII value of […]

## C Program to check if number is even or odd

If a number is exactly divisible by 2 then its an even number else it is an odd number. In this article we have shared two ways(Two C programs) to check whether the input number is even or odd. 1) Using Modulus operator(%) 2) Using Bitwise operator. Program 1: Using Modulus operator /* Program to […]

## C Program to find Palindrome numbers in a given range

In the last tutorial we have learnt how to check if a number is palindrome or not. In this tutorial we will learn how to find palindrome numbers in a given range. C Program – Generating palindrome numbers in a given range #include<stdio.h> int main(){ int num, rem, reverse_num, temp, start, end; printf(“Enter the lower limit: […]

## C Program to check if a number is palindrome or not

If a number remains same, even if we reverse its digits then the number is known as palindrome number. For example 12321 is a palindrome number because it remains same if we reverse its digits. In this article we have shared two C programs to check if the input number is palindrome or not. 1) […]

## C Program to check Armstrong number

A number is called as Armstrong number if sum of cubes of digits of number is equal to the number itself. In the below C program, we are checking whether the input number is Armstrong or not. #include<stdio.h> int main() { int num,copy_of_num,sum=0,rem; //Store input number in variable num printf(“\nEnter a number:”); scanf(“%d”,&num); /* Value […]

## C Program to find prime numbers in a given range

Upon execution of below program, the user would be asked to provide the from & to range and then the program would display all the prime numbers in sequential manner for the provided range. Using this program you can find out the prime numbers between 1 to 100, 100 to 999 etc. You just need […]