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

1.     (a) What will be the output for the following program C code?

 

#include<stdio.h>

int main()

{

                   int a=12, b=4, c;

                   ++a;

                   b++;

                   c=a++ - b;

                   printf(“ %d %d %d\n ”, a, b, c);

                   return 0;


Write a simple C program that accepts user input for the following:






Total number of test items, and percentage of correct answers. For every correct answer a






student gets five (5) points and loses two (2) points for every wrong answer.

Write a C program that accepts an input in integer representing the total number of days




and outputs the equivalent values in years, months and days.

Write a simple Menu-driven program that allows users to select from 1 to 4 to solve the area of



the following geometric shapes (Square, circle, rectangle and triangle). If the users enter numbers



not listed in the menu and “Invalid Input” will be displayed on the screen.



Search the formulas in finding the area of the different geometric shapes.

 (b) What will be the output for the following program C code?

                        #include<stdio.h>

                        int main()

                       {

                              int x=15, b;

                              float c;

                                  b=x/2;

                                  c=x/4;

                                  x=x%2;

                              printf(“ %d %d %f ”, x, b, c);

                                 return 0;

                       }                  


write a program to compute the value of u for different values of x at distinct instances of time and plots the series of graphs on u vs plot.

Create a small Arduino project in tinkerCAD.


The project must make use of at least the following:


● Any 1 of the following analog sensors: TMP36, Flex sensor, Photoresistor, or Force Sensor.


AND


● Any 2 of the following Digital input devices: Pushbutton, Slide switch, or DIP switch.


AND


● Any 1 of the following Digital output devices: LED, or Piezo Buzzer.


AND


● Any 1 of the following PWM output devices: DC Motor, Hobby gearmotor, RGB LED.


AND


● A 16x2 LCD display




In you program you must make use of the following:


● analogRead(), digitalRead(),analogWrite(), digitalWrite()


● if statements and if else statements, (i.e. testing the value of a sensor)


● at least 1 while loop


● at least 1 for loop


● an array


● variables


● The LCD display


● arithmetic ( + , - , * , / , % ) and compound operators (+=,-=,*=,/=,%=)


● Comparison and Logical operators


Arjun wants to count total number of digits of an integer number (N).Help him to generate the programme for the same


There are N coding questions and the score for Ith question must be in the range of 1 to N(inclusive). All the coding questions follow one rule that higher the score higher is difficulty level. Now Tom is trying to assign the score to each question in a sorted difficulty order such that 1st question is of least difficulty level and Nth question is of most difficulty level. And it is also possible that more than one question can have equal score.

Delhi government has issued a circular to control the pollution due to vehicle. It has prohibited the



use of odd numbers registered vehicle on Monday, Wednesday and Friday and not to use even



number registered vehicles on Tuesday, Thursday and Saturday. Sunday they have to use public



transport so no vehicle should be used.A software application is to be developed by Delhi Government which will inform the owner of the



vehicle on which day they can use the vehicle.

LATEST TUTORIALS
APPROVED BY CLIENTS