Individual Assignment
Individual Assignment
Write a C program to ask the user to enter two (2) integer values
(represented by X and Y) between 1 and 100, and the program will print to
the console all of the integer values from X to Y inclusive.
#include <stdio.h>
int main() {
int x, y, i;
// Validate input
if (x <= y) {
} else {
printf("\n");
return 0;
Question 2
Write a C program to ask the user to enter a word of any length, which will
count the number of uppercase and lowercase letters and print the result to
the console.
#include <stdio.h>
#include <ctype.h>
int main() {
int i = 0;
scanf("%s", word);
if (isupper(word[i])) {
uppercaseCount++;
} else if (islower(word[i])) {
lowercaseCount++;
i++;
return 0;
Question 3
the velocity 𝑣 of a massive object using the formula: 𝑣=√𝐺𝑀𝑟, where
Write a C program with the function CircularVelocity() that will calculate
𝐺=6.6743×10−11. The program must ask the user to enter the value for the
mass 𝑀 and radius 𝑟, and print the result on the console.
#include <stdio.h>
#include <math.h>
int main() {
scanf("%lf", &mass);
scanf("%lf", &radius);
return 0;
Question 4
Write a C program that contains the function RemoveVowel () that will
accept a character array as argument, then print the contents in the array
without vowels. The program must ask the user for the word, store it in the
character array in the main () function, then call RemoveVowel () to process
the data.
#include <stdio.h>
#include <string.h>
int i, j;
if (str[i] != 'a' && str[i] != 'e' && str[i] != 'i' && str[i] != 'o' && str[i] != 'u' &&
str[i] != 'A' && str[i] != 'E' && str[i] != 'I' && str[i] != 'O' && str[i] != 'U') {
str[j++] = str[i];
int main() {
char word[100];
scanf("%s", word);
RemoveVowel(word);
return 0;
Question 5
Write a C program to calculate the 2x2 matrix multiplication of A and B. The
user must be allowed to enter the float values for all elements in the
matrices A and B. The result is to be printed to the
console.
#include <stdio.h>
int main() {
int i, j, k;
// Input matrix A
scanf("%f", &a[i][j]);
// Input matrix B
scanf("%f", &b[i][j]);
// Matrix multiplication
result[i][j] = 0;
printf("%.2f\t", result[i][j]);
printf("\n");
return 0;