by CodeChum Admin
Do you still know what being divisible by a certain number means? In case you forgot, being divisible means that the number is capable of being divided by another number without a remainder. With this knowledge, you can surely solve this problem!
Instructions:
Input
1. An integer
Output
The first line will contain a message prompt to input the integer.
The second line contains the appropriate message.
Enter·n:·6
Divisible·by·3
by CodeChum Admin
My friends are geeking out with this new device I invented. It checks if a number is even or odd! 🤯
Do you want to try it out?
Instructions:
Input
1. Integer n
2. N integer values
by CodeChum Admin
We've been giving positive numbers too much attention lately, it's time to let negative numbers take the spotlight this time!
Instructions:
Input
1. First decimal number
2. Second decimal number
3. Third decimal number
4. Fourth decimal number
Output
The first four lines will contain message prompts to input the four decimal numbers.
The last line contains the sum of all the inputted negative numbers, with 2 decimal places.
Enter·the·first·number:·-30.22
Enter·the·second·number:·10.5
Enter·the·third·number:·-2.2
Enter·the·fourth·number:·-1.8
Sum·of·all·negatives·=·-34.22
by CodeChum Admin
This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!
Instructions:
Input
1. A three-digit integer
Output
The first line will contain a message prompt to input the 3-digit integer.
The last line contains the largest digit of the inputted integer.
Enter·a·3-digit·integer:·173
Largest·=·7
by CodeChum Admin
This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!
Instructions:
Input
1. A three-digit integer
Output
The first line will contain a message prompt to input the 3-digit integer.
The last line contains the largest digit of the inputted integer.
Enter·a·3-digit·integer:·173
Largest·=·7
by CodeChum Admin
We've been dealing with integers too much, it's time for float to shine!
Instructions:
Input
1. First float number
2. Second float number
3. Third float number
4. Fourth float number
5. Fifth float number
Output
The first five lines will contain message prompts to input the five float numbers.
The next line contains the inputted float numbers.
The last line contains "Yes" if the condition is true.
Enter·the·first·number:·1.1
Enter·the·second·number:·1.2
Enter·the·third·number:·1.3
Enter·the·fourth·number:·1.4
Enter·the·fifth·number:·1.1
1.1·1.2·1.3·1.4·1.1
Yes
. Are Integers Created Equally?
by CodeChum Admin
It's time to find out if something is true or false. Let's test your capabilities by creating a program that checks if two integers are equal!
Instructions:
Input two integers in one line.
Print the two integers in one line, and separate them with a space.
Print a string message "Equal" on a new line, if both inputted integers are equal.
Input
1. First integer
2. Second integer
Output
The first two lines will contain message prompts to input the two integers.
The next line will contain the inputted integers.
The last line will contain a string which is the result, if the condition were true.
Enter·the·first·integer:·5
Enter·the·second·integer:·5
5·5
Equal
by CodeChum Admin
There are different kinds of numbers, but among them all, the most commonly used numbers in our daily lives are those positive ones. So, I only want you to count all the positive numbers from the 4 outputted values and print out the result.
Go and search for the positive ones among these four!
Input
1. First number
2. Second number
3. Third number
4. Fourth number
Output
The first four lines will contain message prompts to input the four numbers.
The last line contains the total count of all the positive numbers.
Enter·the·first·number:·2
Enter·the·second·number:·-4
Enter·the·third·number:·3.6
Enter·the·fourth·number:·1
Count·of·positives·=·3
3. A linked list is a sequence of data structures, which are connected via links. Write a complete C program to perform the following on a Circular Doubly Linked List (CDLL).
a. Get a number n (1-9) from user and create CDLL with n nodes, which contains the numbers (1, 2, .. n) as the data in the nodes.
b. Display the elements of CDLL.
c. Insert another node (data = 0) as the head of CDLL. Display the elements of CDLL.
d. Convert the CDLL into a DLL.
e. Remove the second node (head->next) from the DLL.
f. Display the elements of DLL in reverse order.
2. Array is the simplest data structure where each data element can be randomly accessed by using its index number. Write a complete C program to create an array and perform the following, using functions.
a. Create an array to store some characters.
b. Get a word (which contains lower case letters only) from the user and store the letters in the array according to the order of letters.
(Ex: If the user Input = campus; Array = ‘c’ ‘a’ ‘m’ ‘p’ ‘u’ ‘s’)
c. Display the elements of the array.
d. Add uppercase letters (A, B, C, …) in between each letter in the array. Then your array length become double. Display the elements of the array.
(Ex: If the Array = ‘c’ ‘a’ ‘m’ ‘p’ ‘u’ ‘s’; After inserting numbers, the array = A c B a C m D p
E u F s)
e. Remove all the lower case letters from the array. Then your array will shrink back to the half size. Display the elements of the array.
(Ex: If the array = A c B a C m D p E u F s; then array = A B C D E F)
f. Display the array again in reverse order.