sum of each digit until its become single digit example (input-1234) 1+2+3+4=10->1+0=1
#include <stdio.h>
int main()
int n,sum=0;
scanf("%d",&n);
while(n!=0||sum>=10){
if(n==0){
n=sum;
sum=0;
sum+=n%10;
n/=10;
printf("%d",sum);
return 0;
}
Patten:
5 prime after given n
Odd/even before given number
Lcm and gcd of given number
Fibbonaci series in given range
Armstrong number
Interger to roman
Cube of nxt three numbers
Nxt 5 plaindrome
Print pattern in multiple of 5 by getting input row
Pattern for rectangle
Swap first and last number
Geometric progression
Leap year in a decade
1)Get two numbers ,check if both numbers are even and return next even number
Digit incremeter(or)Program To Increment By 1 To All The Digits Of A Given Integer Input : 203
Output: 314
Get input row from user and print the following pattern. Input : 3 Output: A
BB
CCC
1.Find Whether the number is abundant number or not I/P:12 Output : Abundant number
explanation:1+2+3+4+6=16 which is 16>12 so it is abundant
Floyd's triangle
count the number of vowels in the string
In a conference hall has n members how many time they will give handshake to each other not more
than once
Square Pattern Input: 4
print factors / divisor of a given number and check the sum of factors are equal to given number or
not (loops)
Harmonic progression
Pattern printing : Input 6 (Only the rows with prime numbers should be printed
Sum of prime
Sum of palindrome upto n
1.1-x^2/2!+x^4/4!-x^6/6!........ find the sum of the series. no of terms and x values will be given