## C program to make prime numbers or check prime numbers

C program to make prime numbers or check prime numbers Problem 1: Write a  C program to check if the number is prime or not. Solution: logic for being a prime number: C Code for check if the number is prime or not: #include <stdio.h>int main(){ int n, c = 2; printf(“Enter a number to […]

## C Program to find the palindrome of given number

C Program to find the palindrome of given number Problem: Write a C program to find the palindrome of a given number. Solution: Logic for palindrome number: Take the number and put it in a temp variable Reverse the number Check the number if that was the taken number or not If that are the […]

## C Program to find the factorial of a given number

C Program to find the factorial of a given number Problem: Write a C program that will get the factorial of the given number. Solution: Logic to make a factorial number: That means, take a number and multiply every number upto one.In programming, take a simple for loop or while loop. Multiply and add the […]

## C program to reverse a given number

C program to reverse a given number Problem: Write a C program to reverse a given number. Logic for getting reverse number in C:Suppose, we’ve given a number 123456, then we’ll get the reverse output of that number like 654321.Logic: Use the techniques of reminder. First take the last part of the number after dividing it […]

## C Program to check the number is a leap year or not?

C Program to check the number is a leap year or not? Problem:  Write a C program to check if the number is a leap year or not. Solution: Logic for a number is leap year or not: C code to check leap year Using simple if-else #include <stdio.h>int main(){ int year; printf(“Enter a year […]

## C Program to check the letter is vowel or consonant

C Program to check the letter is vowel or consonant Problem:  Write a C program to check the letter is vowel or consonant. Solution: C code to check vowel or consonant using if-else #include <stdio.h> int main(){ char ch; printf(“Input a charactern”); scanf(“%c”, &ch); if ((ch >= ‘a’ && ch <= ‘z’) || (ch >= ‘A’ &&ch […]

## Insertion sort in an array – C code implementation

C Program insertion sort in an array  Problem: Write a C program of insertion sort which sorts a list of elements using insertion sort algorithm. What is insertion sort: To know some basic about insertion sort go to Wiki and find that- Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at […]

## C Program to Print Pascal’s triangle

C Program to Print Pascal’s triangle From Wikipedia about Pascal’s triangle is : Pascal’s triangle is a triangular array of the binomial coefficients. In much of the Western world, it is named after French mathematician Blaise Pascal, although other mathematicians studied it centuries before him in India,[1] Persia(Iran), China, Germany, and Italy.[2] Wiki Link – https://en.wikipedia.org/wiki/Pascal%27s_triangle See also how a pascal’s triangle is created in  a gif […]

## C Program to Print Floyd’s Triangle

What is Floyd’s triangle? From Wikipedia, Floyd’s triangle is a right-angled triangular array of natural numbers, used in computer science education. It is named after Robert Floyd. It is defined by filling the rows of the triangle with consecutive numbers, starting with a 1 in the top left corner: 1 2 3 4 5 6 7 8 9 10 11 12 […]

## C Program to print Pyramid by star or numbers

C Program to print Pyramid by star or numbers First Star printing Problem in C: Problem 1: Write the the following star program to print the stars in C language: *************** Problem analysis: First take a variable of rows number to print how many number of rows. Make a for loop upto that the row […]