Answer:
Question 1: C program to calculate the height of a triangle given its area and base
#include <stdio.h>
#include <math.h>
int main() {
double area, base, height;
printf("Enter the area: ");
scanf("%lf", &area);
printf("Enter the base: ");
scanf("%lf", &base);
height = sqrt(area / (base * 2.0));
printf("The height of the triangle is: %.2lf\\", height);
return 0;
}
Question 2: C program to check whether the entered character is a vowel
#include <stdio.h>
int main() {
char c;
printf("Enter a character: ");
scanf("%c", &c);
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
printf("It's a vowel!");
} else {
printf("It's not a vowel!");
}
return 0;
}
Question 3: C program to find the greatest number in a sequence
#include <stdio.h>
#include <math.h>
int main() {
int num;
int max = 0;
while (scanf("%d", &num) == 1) {
if (num > max) {
max = num;
}
}
printf("The greatest number is: %d\\", max);
return 0;
}
Question 4: C program to display the multiplication table of an entered number
#include <stdio.h>
int main() {
int num, i, j;
printf("Enter a number: ");
scanf("%d", &num);
for (i = 1; i <= num; i++) {
for (j = 1; j <= num; j++) {