# c-program

## C program to check eligibility for voting

In this program, we will take a person’s age and check it’s eligibility for voting. In India, the minimum age for voting is 18 years. So, we need to check whether the person’s age is greater than or equal to 18. For this, we will use the conditional statements- if […]

## C program to find the average of two numbers

In this program we will calculate the average of two integer numbers. #include<stdio> int main() { int num1 = 12, num2 = 16, result; result = (num1 + num2)/2; printf("The average is %d", result); return 0; } Explanation In this example we are using the mathematical formula to find average

## C program to add two integer numbers

In this example we will add two numbers stored in two individual variables. We will see this example in two different versions. In the first one, we will store the numbers in the variables by ourselves and in the second version we will ask a user to enter two numbers and

## C program to print a number stored in a variable

In this program we will see how we can print the value stored in a variable. To understand this program you should have the knowledge of following topics in C: variables output functions Program #include<stdio> int main() { int a = 4; printf("The number is %d", a) return 0; }

## C program to print Hello World

In this example, we will learn step by step how to print “Hello World” in C. It has always been like a tradition, that when you start learning a new programming language, you start with the program that prints the message “Hello World”. #include <stdio.h> int main() { //The printf() function will display the