Write a program that reads an integer and determines and prints whether it is odd or
even.
a) first the program using if statements
b) then the program using if/else statements
Write a program that reads in five integers and determines and prints the largest and
the smallest integers in the group. Use only the programming techniques you learned
up to now.
Write a program that reads in the radius of a circle and prints the circle's diameter,
circumference, and area. Use the constant value 3.14159 for p. Do all calculations in
output statements.
Family List:
A list of words is called the Family if the words in the list follow the following rule.
we should be able to obtain each word in the list by
-changing exactly one letter from the previous word in the list
-or , by adding exactly one letter to the previous word in the list
-or ,by removing exactly one letter from the previous word in the list
Given a list of words ,determine if the list is a Family or Not a Family
input:
The first line of input is an integer T representing the number of test cases
the first line of each test case has an integer N representing the total number of words
The second line contains N space separated strings
INPUT:
3
3
hip hop top
3
hip top hop
4
teat treat greet meet
output:
family
not a family
not a family
i/p:
3
3
tic tac toe
2
tic tac
3
tet treat greet
o/p:
not a family
family
not a family
You are on the top floor of a multiplex complex and want to go the ground floor,The lift is not working so you have to search for the staircase on each floor and go down to the exit.
As you are new to that multiplex,you have taken the floor map.you are given a map. M of building in a 2D matrix.
. All walkable space are represented by a 0
. Staircases are represented by a 1
.your starting position is represented by 2 and can be at any level of the car park
.Exit is always at the bottom right of the ground floor
. you must use the staircases 1 s to go down a level
.Each floor will have only one staircase apart from the ground floor which will not have any staircases.find the quickest route of the multiplex complex
input:the first line of input contains two space separated integer N representing the number of rows and C representing the number of columns
the next N lines contain C space-separated integers
I/P: 3 3
1 0 2
0 1 0
0 0 0
O/P:L2 D1 R1 D1 R1
Write a program that will accept five (5) grades. Use an array in
storing the five (5) grades. Calculate the average of five (5) grades and
determine the remark of the average if PASSED or FAILED. Write a
function in accepting the five (5) grades, function in calculating the
average of the five (5) grades and a function in determining the remark of
the average.
Family List:
A list of words is called the Family if the words in the list follow the following rule.
we should be able to obtain each word in the list by
-changing exactly one letter from the previous word in the list
-or , by adding exactly one letter to the previous word in the list
-or ,by removing exactly one letter from the previous word in the list
Given a list of words ,determine if the list is a Family or Not a Family
input:
The first line of input is an integer T representing the number of test cases
the first line of each test case has an integer N representing the total number of words
The second line contains N space separated strings
Names and nicknames:
There are N persons in a society .You know the names and nicknames of all of the N people in society. Your task is to determine if there any two persons who have the same name and nickname
input:
The first line of input contains integer N
Each of next N lines contains two space separated strings denoting the name and nickname of person
output:
print YES if there is a pair of people with the same name and nickname otherwise print NO
i/p:
2
3
stephen steve
sato hanako
stephen steve
2
conan kun
subaro kun
o/p:
yes
no
i/P:
2
3
thomas cat
jerry mouse
johny bravo
3
nicolas tesla
saito san
nicolas tesla
o/p:
no
yes
A problem in a test given to small children asks them to match each of three pictures
of animals to the word identifying that animal. If a child assigns the three words at
random to the three pictures, find the probability distribution for Y , the number of
correct. matches
Calculate the following:
1.1.1(-39)0
1.1.2 (9)5/7 rounded off to 3 significant figures
1.1.3 -5 +3 รท 2
1.1.4 -(-32)0
1.2 Find the value for the expression (x2)3 / x5