# C Programming Code Examples

## Learn C Language

### If Else Statement in C Programming Language

**If Else Statement in C**

**Syntax for if-else Statement in C**

if (test expression) {
// run code if test expression is true
}
else {
// run code if test expression is false
}

/* if else statement in C language */
// Check whether an integer is odd or even
#include <stdio.h>
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
// True if the remainder is 0
if (number%2 == 0) {
printf("%d is an even integer.",number);
}
else {
printf("%d is an odd integer.",number);
}
return 0;
}

C Coding calculate the Fibonacci Numbers in the series. First two numbers in the Fibonacci sequence are 0, 1 & each subsequent number is the sum of the previous 2. Fn = Fn-1 + Fn-2

Program to find HCF of a given number using recursion. Programming code using recursion finds the HCF of 2 entered integers. The 'HCF' stands for Highest Common Factor. Enter the

C program to read elements in a matrix and check whether the matrix is upper triangular matrix or not. Check upper triangular matrix. To check whether a matrix is upper triangular