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 : 




Sunday, November 3, 2019

                                     E-BOX    

                               BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM  - 4:

 A number is said to be an approximate value of the other if they differ by utmost 0.5.

So write a  program to find whether the given number is Approximate number of other.
Input Format:
Input consists of Two Float type numbers.
Output Format:
Displays Whether the number is approximate or not.
 
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and output 1:
Enter the Two numbers:
14
14.3
Approximate number
 
Sample Input and output 2:
Enter the Two numbers:
15
14.8
Approximate number
 
Sample Input and output 3:
Enter the Two numbers:
13
14.3
Not an Approximate number



SOLUTION : 



                                 E-BOX    

                           BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM - 3

                                            Pie Eating Contest

At the State Fair Pie Eating Contest all contestants in the heavyweight division must weigh within 30 pounds of 250 pounds. Write a program that asks for a contestant's weight and then says if the contestant is allowed in the contest.

 

Input Format:

Input consists of an integer which corresponds to the contestant's weight in pounds.

 

Output Format:

Output consists of a string “IN” or “OUT”.

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 contestants weight

240

IN



SOLUTION :




Friday, November 1, 2019

                                                                         E-BOX    

                                  BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM  - 2   

                                                                 A Task

 A task is given to 3 persons to complete it within a particular time. If the person exceeds the time limit he will be disqualified. Only those who complete it within the given time  is qualified.Among the qualified persons, the person who completes the task first will be rewarded.

Write a program to find the person who is rewarded.
 
Input Format:
First input corresponds to the Time limit for the task in hours.  Second,Third and Fourth Inputs
correspond to the number of hours Taken by the first , second and third persons respectively to
complete the task.
 
Output Format:
Display the person who completes first.
All text in bold corresponds to input and the rest corresponds to output]
 
Sample Input and Output 1:
Time Limit:
10
Time taken by first person:
5
Time taken by second person:
6
Time taken by third person:
4
Third person wins!!!

 
Sample Input and Output 2:
Time Limit:
5
Time taken by first person:
3
Time taken by second person:
6
Time taken by third person:
4
First person wins!!!

 
Sample Input and Output 3:
Time Limit:
4
Time taken by first person:
9
Time taken by second person:
6
Time taken by third person:
7
No person wins:-(


SOLUTION :



                                      E-BOX    

                                  BASICS OF C PROGRAMMING   

Conditional Statements :-  Learning Resourcses

 PROBLEM 

COLLECT FLAGS - I

 COLLECT FLAGS I

In "Collect Flags" game, Disney flags will be placed along each path. The path is numbered starting from 1. The task is to collect the flags placed only in the path whose number is even. Patrick and Johnny are confused. Help them to find whether a given path number is odd or even.


Input Format:
Input consists of a single integer representing the path number.

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

Sample Input 1:
3

Sample Output 1:
3 is an odd number

Sample Input 2:
44

Sample Output 2:
44 is an even number


SOLUTION :



                                                                 E-BOX    

                          BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM  - 1:                                                      

                                                        Approximate Value

 Phineas and  Ferb, who live in the fictional town of Danville,think and do innovative things on weekends.Every day the boys embark on a grand new project, which annoys their controlling sister, Candace, who tries to bust them. One sunday ,they were both sitting under a tree in their back yard. They decide to invent a machine which would allow us to enter 2 numbers and it would say whether one of the entered number is an approximate value of the other number entered. They decide to insert a program code in the machine.

A number is said to be an approximate value of the other if they differ by utmost 0.5.
So write a  program to find Whether the given number is Approximate number of other.
Input Format:
Input consists of Two Float type numbers.
Output Format:
Displays Whether the number is approximate or not.
 
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and output 1:
Enter the Two numbers:
14
14.3
Approximate number
 
Sample Input and output 2:
Enter the Two numbers:
15
14.8
Approximate number
 
Sample Input and output 3:
Enter the Two numbers:
13
14.3
Not an Approximate number



SOLUTION :




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

https://amzn.to/2LAmadv