Saturday, November 16, 2019

                                   E-BOX    

                             BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM -16:

                                               LAB SEATING ARRANGEMENT

 There are 2 programming labs, each with a seating capacity of 90. There are 240 students with registration numbers from 1 to 240. All 240 students cannot be accomodated in the labs at the same time. It has been decided to conduct theory classes for 60 students every week. It has been planned to conduct theory classes for all students with registration numbers being a multiple of 4. Students with registration numbers from 1 to 120 with registration numbers not a multiple of 4 need to be seated in Programming Lab I and students with registration numbers from 121 to 240 with registration numbers not a multiple of 4 need to be seated in Programming Lab II.

Given the registration number of a student, write a  program to specify the lab or hall in which the student needs to be seated.

 

Input Format:

Input consists of 1 integer which corresponds to the registration number of the student.

 

Output Format:

Output consists of the string “Lab 1” or “Lab 2” or “Theory Session”.

Refer sample input and output for further formatting specifications.

 

Sample Input and Output:

[All text in bold corresponds to input and the rest corresponds to output]

 

Enter the registration number of the student

3

Lab 1


SOLUTION :




Friday, November 15, 2019

                                                                   E-BOX    

                            BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM -15:

                                     CHARACTER – UPPER OR LOWER

Write a  program that accepts a character as input and checks whether it is an uppercase letter or lowercase letter or neither.

 

Input Format:

Input consists of a single character.

Output Format:

Output consists of a single line. Refer sample output for the format.

 

Sample Input 1 :

c

Sample Output 1 :

c is lowercase letter

 

Sample Input 2:

A

Sample Output 2:

A is uppercase letter

 

Sample Input 3:

5

Sample Output 2:

5 is neither an uppercase or lowercase letter




SOLUTION :




Thursday, November 14, 2019

                                  E-BOX    

                             BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM - 14
                                                             

                                                           CALCULATE GRADE

 Write a program that accepts the marks in 3 subjects of a student , calculates the average mark of the student and prints the student's grade. If the average mark is greater than or equal to 90, then the grade is 'A'. If the average mark is 80 and between 80 and 90, then the grade is 'B'. If the average mark is  70 and between 70 and 80, then the grade is 'C'. If the average mark is  60 and between 60 and 70, then the grade is 'D'. If the average mark is 50 and between 50 and 60, then the grade is 'E'. If the average mark is less than 50, then the grade is 'F'.

 

Input Format:

Input consists of 3 lines. Each line consists of an integer.

Output Format:

Output consists of a single line. Refer sample output for the format.

 

Sample Input 1 :

45

45

45

Sample Output 1 :

The grade is F


Sample Input 2:

91

95

100

Sample Output 2:

The grade is A




SOLUTION :


 


Sunday, November 10, 2019

                                     E-BOX    

                               BASICS OF C PROGRAMMING   


Conditional Statements :-  Code Analysis

 PROBLEM -10:

                                                                LIFT I

 

The Personalized Gifts store is in the nth floor.


Sita gets into a lift in the ground floor.



The lift that Sita gets in does not stop in all floors. It stops in only 3 floors numbered n1, n2 and n3.

She wants to get down in the floor that is closest to n. If there are 2 choices, she always prefers to climb down the stairs rather than climbing up.

Help Sita in deciding the floor she should get down from the lift.

 

Input and Output Format:

Input consists of 4 integers corresponding to n, n1, n2 and n3.  [n1<n2<n3]

Output consists of an integer that corresponds to the floor number where she would get down.

 

Sample Input 1:

10

4

8

15

Sample Output 1:

8

 

Sample Input 2:

10

4

8

12

Sample Output 2:

12



SOLUTION :


INPUT 1   INPUT 2    INPUT 3   INPUT 4  INPUT 5   INPUT 6   INPUT 7

20             20              50             30            40            25             12

19             12              40             17            24            19             10

22             19              45             32            39            22             14

27             27              49             25            41            26             33












Friday, November 8, 2019

                                      E-BOX    

                                BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM - 9:

Mickey mouse 

Mickey and Minnie are friends. Mickey wants to fly a balloon to Minnie. There were 50 hot balloons numbered from one. Each balloon will fly to a certain height. Only the numbers  having  3 and 7 as its factors can fly upto the height of the Minnie's balloon. Mickey was confused and he didn't know the balloon with which number can fly to Minnie.

So write a C program to help the Mickey in finding the balloon.

 

Input format:

Inputs consists of a single integer which corresponds to number printed on the balloon. Assume that the input value is between 1 and 50.

 

Output Format:

Display whether the given Balloon will fly to Miney or Not.

[All text in bold corresponds to input and the rest corresponds to output]

 

Sample Input and Output 1:

Enter the Balloon's number:

42

This balloon can fly to miney.

 

Sample Input and Output 2:

Enter the Balloon's number:

24

This balloon cannot fly to miney.


SOLUTION :



                                      E-BOX    

                                  BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM - 8

                                                                    POOL

 You are planning to go for swimming classes. You prefer to enrol in the center which has the swimming pool of a greater area. In the first centre that you visit, the swimming pool is in circular shape(radius – r) . In the next centre that you visit, the swimming pool is in square shape(side – s).

Write a program that will help you to make the choice of the swimming pool.

 Input:

Input consists of 2 integers. The first integer correspond to the radius(r) of the circular swimming pool, The second integer corresponds to the side(s) of the square swimming pool.

 Output:

Refer Sample Output for format.

 [Take the value of pi as 3.14]

 Sample Input 1:

Radius:

3

Side:

4

Sample Output 1:

I prefer centre 1

Sample Input 2:

Radius:

10

Side:

1

 Sample Output 2:

I prefer centre 1



SOLUTION :




Thursday, November 7, 2019

                                      E-BOX    

                                 BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM  - 7

                                                              Blood bank

              A team from Rotract club had planned to conduct a rally to create awarness among the people of coimbatore to donate blood. The rally was comducted successfully . Many of the coimbatore people realized it and came forward to donate their blood to the near by blood bank.  The eligibility criteria for donating blood is people should be above 18 and his/ her weight should be above 40. There was a huge crowd and the staff in blood bank found it difficult to manage the crowd. So they decided to keep a system and ask the people to enter their age and weight in system. If the person is eligible he / she will be allowed inside.

Write a  program and  feed it to  the system  to find whether a person is eligible or not.

Input Format:

Input consists of two integers which corresponds to age and weight of a person respectively.

Output Format :

Display whether the person is eligible or not.

Sample input and output 1:

[All text in bold corresponds to input and the rest corresponds to output]

Age:

19

Weight:

50

Eligible to donate.

Sample input and output 2:

Age:

17

Weight:

50

Not Eligible to donate.


SOLUTION :



Wednesday, November 6, 2019

                                                                       E-BOX    

                               BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM  : 6

                                                               PROJECT

The Final year students have been allotted separate computers in  three different labs for their projects . The labs and projects are allocated based on the students CGPA in accordance with the following table. Can you help the HOD to allocate the labs to the students ???

 

CGPA

LAB

Below 6.3

Cryptography Lab

6.3-8.5

Networking Lab

Above 8.5

Research Lab

 

Input format:

Input consists of a floating point number corresponding to the CGPA of the student.

Output format:

Output consists of a string corresponding to the lab’s name.

Refer sample input and output for further formatting specifications.

 

Sample Input and Output:

[All text in bold corresponds to input and the rest to output]

Enter CGPA:

6.0

Cryptography Lab



SOLUTION : 




                                                 E-BOX                                                     BASICS OF C PROGRAMMING       i -...

https://amzn.to/2LAmadv