C Answers

Questions answered by Experts: 1 680

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Instructions:

  1. Input a 3-digit integer.
  2. Print the largest digit in the integer.
  3. Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.
  4. Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.
  5. Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer.

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


Enter a 3-digit integer: 109
Largest = 9


Enter a 3-digit integer: 666
Largest = 6

Instructions:

  1. Input four float numbers; they could be positive or negative.
  2. Only add all inputted negative numbers, and print its sum, up to 2 decimal place.
  3. Hint: The previous/latest topic is about if-else-elseif statements, but do we need one here?


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


Enter the first number: 50.23
Enter the second number: 100.23
Enter the third number: -123.4
Enter the fourth number: 0.0
Sum of all negatives = -123.40

Instructions:

  1. Input three integers.
  2. Print the integers in ascending order using your knowledge on conditional statements.


Input


1. First integer

2. Second integer

3. Third integer

Output


The first three lines will contain message prompts to input the 3 integers.

The last line contains the three integers in ascending order.


Enter the first integer: 6
Enter the second integer: 1
Enter the third integer: 3
1 3 6

1) write a program for the development board that measures gravitational acceleration in 3-axes and displays the values on the LCD screen.

The program will do the following:


a) To be run upon initialization (i.e. implement this in the setup() function)

• Initialize the development board

• Sound the buzzer

• Write the message “ACCELEROMETER” on the LCD screen.

• Wait two seconds

• Sound the buzzer


write a program which takes the input from these arrays and decides the maximum runs that your favourite player has to score so far in order to get the orange cap. [The orange cap is awarded to the person who scores maximum runs in the tournament]. Also, please find out the maximum strike rate achieved by a batsman so far. Note: In total you are given 8 arrays represent the runs scored and the next 4 represent the total number of balls faced.

Sample Run:

Input:


[10, 45, 500, 400, 45, 56, 67, 78, 100, 8, 11]

[100, 450, 510, 410, 415, 56, 68, 87, 101, 9, 9]

[404, 445, 520, 450, 415, 156, 167, 488, 110, 4, 2]

[505, 445, 554, 410, 445, 556, 167, 178, 70, 4, 1]


[20, 100, 500, 345, 45, 65, 86, 69, 100, 7, 10]

[101, 246, 500, 355, 145, 165, 45, 45, 54, 8, 9]

[434, 456, 550, 395, 445, 165, 96, 369, 100, 4, 6]

[520, 340, 500, 405, 345, 565, 186, 169, 67, 3, 2]


Output:

Maximum Runs Scored: 556

Maximum Strike Rate: 286.206897​



2. Mr. Raju want to read 10 array elements and wants to display them in the reverse way. Write a C








program to help Mr. Raju to display the array elements in the reverse way

Vijayalaksmi wants to check the number of times the word “ India” appears in a given


paragraph. Write a C program without using string function to do

How is the number of loop iterations needed to search a sorted array related to its size?



Write a program to create an expression tree for a given PREFIX expression and traverse the tree to check the correctness of the prefix expression.




2. Mr. Raju want to read 10 array elements and wants to display them in the reverse way. Write a C program to help Mr. Raju to display the array elements in the reverse way.






LATEST TUTORIALS
APPROVED BY CLIENTS