Identifying a compressed gas cylinder is
based on the first letter of the
cylinder’s color printed on the cylinder. For Example
‘Y’ or ‘y’ for yellow, ’O’
or ‘o’ for orange and so on. Cylinder colors and associated contents are as
follows.
Orange
--
Ammonia
Brown
--
Carbon monoxide
Yellow
--
Hydrogen
Green
--
Oxygen.
Write a C program using switch case to identify the type of gas compresse
d
in a given cylinder.
Computers process data under the control of sets of instructions called
The national earthquake information center characterizes the effect of
earthquakes based on Richter scale numbers. Write a C program to implement
the following decision table
.
Ritcher scale number (n)
Characterization
n<5.0
Little or no damage
5.0 <= n < 5.5
Some damage
5.5 <= n < 6.5
Serious damage: Walls may crack or fall
6.5 <= n < 7.5
Disaster: houses and buildings may collapse
Higher
Catastrophic: most
buildings destroyed
You are given a binary compass which shows the direction you are safe to go to.
The binary compass read n binary digits (bits) which interprets 1 to rotate 90°
to
the left and 0 rotate 90°
to the right. Initially you are facing North. Create a program
for this binary compass.
Write a menu driven program which has the following options:
1. Factorial of a number
2. Prime or not
3. Odd or Even
4. Exit
Make a program that prints out the first 8 multiples of a given integer y. Please use
for loop
While purchasing certain items, a discount of 10% is offered if the quantity
purchased is more than 1000. If quantity and price per item are input through the
keyboard, write a program and a flowchart to calculate the total expenses.
The placement session has begun in a college. There is N number of students standing outside an interview room in a line. It is given that the person who goes first has higher chances of selection.
Each student has a number associated with them representing their problem-solving capability. The higher the capability the higher the chances of selection. Now every student wants to know the number of students ahead of him with higher problem-solving capability.
Input: 6(number of students) {4 , 9 , 5 , 3 , 2 , 10}
Output: {0 , 0 , 1 , 3 , 4 , 0}
by CodeChum Admin
Let's try defining the size of the array and create the contents of it on our own! And then, to give off a sense of excitement, let's try accessing the value of an array element in a random index position!
Let's do this fast!
Instructions:
Input
1. A string
2. An index
Output
The first line will contain a message prompt to input the string.
The second line will contain a message prompt to input the integer which represents the index.
The last line contains the character at the index.
Enter·the·string:·Cody
Enter·the·index:·3
Character·at·index·3·=·yWrite a program to find sum of following series for a given value of ‘n’:
A) 1 + 1/2 - 1/3 + 1/4 - 1/5 + 1/6 +……+ 1/n