11. Calculate simple interest.
Required Input:
principal = 1000, rate = 5, time = 2Expected Output:
Simple Interest = 100.00Code In C
#include <stdio.h>
int main() {
float principal = 1000, rate = 5, time = 2;
float interest;
// Logic to calculate simple interest
return 0;
}
Run Code?
Click Run Button to view compiled output
12. Check if a character is a vowel.
Required Input:
ch = 'a'Expected Output:
VowelCode In C
#include <stdio.h>
int main() {
char ch = 'a';
// Logic to check for vowel
return 0;
}
Run Code?
Click Run Button to view compiled output
13. Calculate power of a number.
Required Input:
base = 2, exponent = 3Expected Output:
Power = 8Code In C
#include <stdio.h>
int main() {
int base = 2, exponent = 3;
int result = 1;
// Logic to calculate power
return 0;
}
Run Code?
Click Run Button to view compiled output
14. Find the GCD of two numbers.
Required Input:
a = 8, b = 12Expected Output:
GCD = 4Code In C
#include <stdio.h>
int main() {
int a = 8, b = 12;
int gcd;
// Logic to find GCD
return 0;
}
Run Code?
Click Run Button to view compiled output
15. Check if a number is prime.
Required Input:
num = 17Expected Output:
PrimeCode In C
#include <stdio.h>
int main() {
int num = 17;
int is_prime = 1;
// Logic to check for prime
return 0;
}
Run Code?
Click Run Button to view compiled output
16. Find the LCM of two numbers.
Required Input:
a = 4, b = 5Expected Output:
LCM = 20Code In C
#include <stdio.h>
int main() {
int a = 4, b = 5;
int lcm;
// Logic to find LCM
return 0;
}
Run Code?
Click Run Button to view compiled output
17. Check if a number is an Armstrong number.
Required Input:
number = 153Expected Output:
Armstrong NumberCode In C
#include <stdio.h>
int main() {
int number = 153;
int sum = 0, temp, remainder;
// Logic to check Armstrong number
return 0;
}
Run Code?
Click Run Button to view compiled output
18. Reverse a string.
Required Input:
str = "hello"Expected Output:
ollehCode In C
#include <stdio.h>
#include <string.h>
int main() {
char str[] = "hello";
char reversed[100];
// Logic to reverse the string
return 0;
}
Run Code?
Click Run Button to view compiled output
19. Find the sum of even numbers up to n.
Required Input:
n = 10Expected Output:
Sum = 30Code In C
#include <stdio.h>
int main() {
int n = 10;
int sum = 0;
// Logic to calculate sum of even numbers
return 0;
}
Run Code?
Click Run Button to view compiled output
20. Check if a string is a palindrome.
Required Input:
str = "madam"Expected Output:
PalindromeCode In C
#include <stdio.h>
#include <string.h>
int main() {
char str[] = "madam";
int is_palindrome = 1;
// Logic to check palindrome
return 0;
}
Run Code?
Click Run Button to view compiled output


