C program to check whether a number is palindrome or not

Write a C program to input number from user and check number is palindrome or not using loop. How to check whether a number is palindrome or not using loop in C programming. Logic to check palindrome number in C programming.

Example

Input

Input any number: 121

Output

121 is palindrome

Read more

C program to find reverse of a number

Write a C program to input a number from user and find reverse of the given number using for loop. How to find reverse of any number using loop in C program. Logic to find reverse of a number in C programming.

Example

Input

Input number: 12345

Output

Reverse of 12345 = 54321

Read more

C program to find first and last digit of any number

Write a C program to input a number from user and find first and last digit of number using loop. How to find first and last digit of a number in C programming. Logic to find first and last digit of a given number without using loop in C program.

Example

Input

Input number: 1234

Output

First digit: 1
Last digit: 4

Read more

C program to find sum of natural numbers from 1 to n

Write a C program to find the sum of all natural numbers between 1 to n using for loop. How to find sum of natural numbers in a given range in C programming. Logic to find sum of all natural numbers in a given range in C programming.

Example

Input

Input upper limit: 10

Output

Sum of natural numbers 1-10: 55

Read more

C program to find product of digits of a number

Write a C program to input a number from user and calculate product of its digits. How to find product of digits of a number using loop in C programming. Logic to find product of digits of a given number in C program.

Example

Input

Input number: 1234

Output

Product of digits: 24

Read more

C program to find sum of digits of a number

Write a C program to input a number and calculate sum of digits using for loop. How to find sum of digits of a number in C program. Logic to find sum of digits of a given number in C programming.

Example

Input

Input any number: 1234

Output

Sum of digits: 10

Read more

C program to find factorial of a number

Write a C program to input a number and calculate its factorial using for loop. How to find factorial of a number in C program using loop. Logic to find factorial of a number in C programming.

Example

Input

Input number: 5

Output

Factorial: 120

Read more

C program to find all factors of a number

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

Example

Input

Input number: 12

Output

Factors of 12: 1, 2, 3, 4, 6, 12

Read more

C program to print multiplication table of a given number

Write a C program to input a number from user and print multiplication table of the given number using for loop. How to print multiplication table of a given number in C programming. Logic to print multiplication table of any given number in C program.

Example

Input

Input num: 5

Output

5 * 1  = 5
5 * 2  = 10
5 * 3  = 15
5 * 4  = 20
5 * 5  = 25
5 * 6  = 30
5 * 7  = 35
5 * 8  = 40
5 * 9  = 45
5 * 10 = 50

Read more