C program to print rhombus or parallelogram star pattern

Write a C program to print rhombus star pattern of N rows using for loop. How to print rhombus or parallelogram star pattern using for loop in C programming. Logic to print rhombus or parallelogram star pattern series in C program.

Example

Input

Enter number of rows: 5

Output

Read more

C program to print all even numbers between 1 to n using while loop

Write a C program to enter any number from user and print all even numbers between 1 to n using while loop. C program to display even number in a given range using while loop. How to generate even numbers from 1 to n using while loop in C programming.

Example

Input

Input value of n: 10

Output

Even numbers between 1 to 10: 2, 4, 6, 8, 10

Read more

C program to create calculator using switch case and functions

Write a C program to create menu driven calculator that performs basic arithmetic operations (add, subtract, multiply and divide) using switch case and functions. The calculator should input two numbers and an operator from user. It should perform operation according to the operator entered and must take input in given format.

<number 1> <operator> <number 2>

Example
Input

5.2 - 3

Output

2.2

Read more

C program to find sum of prime numbers between 1 to n

Write a C program to find sum of all prime numbers between 1 to n using for loop. C program to generate sum of all primes between a given range. Logic to find sum of prime numbers in a given range.

Example

Input

Input upper limit: 10

Output

Sum of prime numbers between 1-10: 17

Read more

C program to find LCM of two numbers

Write a C program to input two numbers from user and find LCM (Lowest Common Multiple) using loop. How to find LCM of two given numbers in C programming. Logic to find LCM of two number in C program.

Example

Input

Input number1: 12
Input number2: 30

Output

LCM = 60

Read more

C program to find HCF (GCD) of two numbers

Write a C program input two numbers from user and find the HCF using for loop. How to find GCD of two given numbers using loops in C programming. Logic to find HCF of two number in C programming. Example Input Input first number: 12 Input second number: 30 Output HCF of 12 and 30: … Read more

C program to find prime factors of a number

Write a C program to input a number from user and find Prime factors of the given number using loop. C program to list all prime factors of a given number. Logic to find prime factors of a number in C programming.

Example

Input

Input any number: 10

Output

Prime factors of 10: 2, 5

Read more