21SC1101-P-Delivery Plan
21SC1101-P-Delivery Plan
21SC1101-P-Delivery Plan
1 1. An American tourist came to India to visit the Taj Mahal. The security checked
his temperature before allowing him inside. American wanted to know his
temperature in Fahrenheit, but the security person’s thermometer showed in
degrees Celsius. Help the security person to convert the temperature in
degrees Celsius to Fahrenheit.
2. Anuj takes a loan of Rs.7,00,000 to pay his B.Tech fees from his friend at
12.5% rate of interest. He needs to clear the dues to get the No Objection
Certificate. Help him in finding out the amount to be paid with interest to the
bank. Interest is computed using Simple Interest for a period of 4 Years
2 1. A hen lays one golden egg and one silver egg alternatively let us assume that
a hen lays a golden egg on the first day and so on. Now our task is to compute
on which day 15th golden egg is laid. (Hint : 2*n-1)
2. Assume a hall with the capability of 10 seats and every occupied seat is
represented with 1 and the empty seat with 0. Rahul was asked to code the
program to count the total number occupied and empty seats.
3. Manish works in a supermarket in billing. Rahul bought 10 pens and 5
chocolates. Each pen costs Rs. 1.5 and each chocolate costs Rs. 10. Find the
total bill amount and remaining change.
60 70 80 90 90
Our task is to Find out total runs he scored in the Tri-series and print his average
score by reading his individual match score from file ‘kuldeep.txt’.
2. Predict the output and trace the values
#include <stdio.h>
static int gInt = 1;
static void staticDemo() {
static int i;
printf("%d ", i);
i=i+1;
printf("%d\n", gInt);
gInt =gInt+1;
}
int main() {
staticDemo();
staticDemo();
}
3. Predict the output for the following
#include<stdio.h>
int fun();
int num = 5;
int main()
{
fun();
printf("\nglobal num value =%d \n",num);
fun();
printf("\nglobal num value =%d \n ",num);
fun();
printf("\nglobal num value =%d \n ",num);
return 0;
}
int fun()
{
static int num = 2;
printf("\nstatic num value = %d \n",num);
num=num+1;
return 0;
}
4 1. Your local library needs your help! Given the expected and actual return
dates for a library book, create a program that calculates the fine (if any).
The fee structure is as follows:
a. If the book is returned on or before the expected return date, no
fine will be charged (i.e.fine=0)
b. If the book is returned after the expected return day but still
within the same calendar month and year as the expected return
date,
fine= 15Hackos*(the number of days late)
c. If the book is returned after the expected return month but still
within the same calendar year as the expected return date,
fine=500 Hackos*(the number of months late)
d. If the book is returned after the calendar year in which it was
expected, there is a fixed fine of 10000 Hackos.
Link: https://www.hackerrank.com/challenges/library-fine/problem
2. Rama wants to categorise the numbers into 2 types less than or equal to
9 and greater than 9. Can you please sow your C language skills to make
a solution for him? Given a positive integer denoting n, do the following:
a. If 1<=n <=9 print the lowercase English word corresponding to
the number (e.g., one for , two for , etc.).
b. If n>9 print Greater than 9.
Link: https://www.hackerrank.com/challenges/conditional-statements-
in-c/problem
3. Krishna is playing with his mobile and his mother tries to teach him basic arithmetic
calculations in mobile. Whenever he clicks on + symbol it performs addition likewise other
operations are also explained. Now Krishna is assigned to take two numbers and perform
the basic arithmetic operations. Now your task is to help Krishna in choosing the symbol
and its operation. (Hint: + addition, - subtraction, * multiplication, / division operations
using Switch Statement)
5 1. Develop a Program to find power of a number using while loops. The base number (>0) and
exponent (>=0) is taken from the test cases
Link: https://www.hackerrank.com/challenges/power-of-large-
numbers/problem?h_r=internal-search
2. Develop a C program to generate Fibonacci numbers
Link: https://www.hackerrank.com/challenges/fibonacci-finding-
easy/problem
https://www.hackerrank.com/challenges/staircase/problem?h_r=internal-
search
3. Develop a C program to print the following Pyramid pattern up to Nth row
https://www.hackerrank.com/challenges/staircase/problem?h_r=internal-
search
6 1. Ram and Shyam are celebrating their birthdays, when their friends meet them and handover
the presents to them, they decide to give chocolates and balloons as return gifts. Ram gives
chocolates and Shyam gives the same number of balloons as number of chocolates. Ram
notices that there are large number of chocolates, so he decides to increase the number of
chocolates by 2. If the first person gets 2 chocolates, Ram asks the next person what the
next power is of 2 and if he answers he receives correct number of chocolates. Your task is
to help Ram in calculating the next power of 2
2. Gudi, a fun-loving girl from the city of Dun, travels to Azkahar - a strange land beyond the
mountains. She arrives at the gates of Castle Grey, owned by Puchi, the lord of Azkahar to
claim the treasure that it guards. However, destiny has other plans for her as she must move
through floors, crossing obstacles on her way to reach the treasure. The gates of the castle are
closed. An integer N is engraved on the gates. A writing on the wall says Tap the gates as
many times as there are unordered pairs of distinct integers from 1 to N whose
bitwise XOR does not exceed N. Help her find the number of the times she has to tap.
Input:
First Line contains an integer T; T test cases follow.
Each test case consists of an integer N.
Output:
Print the answer to each test case in a newline
3. Ricky’s Computer teacher taught him the number systems and conversions. He also was
taught the concept of palindrome few classes ago. He tries to see if the binary equivalent of a
decimal number is palindrome or not. Your task is to help Ricky to find equivalent decimal
number to its binary using bitwise operators
8 1. Given a sorted array of distinct integers and a target value, return the index if the target is
found. If not, return the index where it would be if it were inserted in order.
Practical link: https://leetcode.com/problems/search-insert-position/
2. Given an array of integers nums which is sorted in ascending order, and an integer target,
write a function to search target in nums. If target exists, then return its index. Otherwise,
return -1. Practical link: https://leetcode.com/problems/binary-search/
3. Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of
the two sorted arrays.
Practical link : https://leetcode.com/problems/median-of-two-sorted-arrays/
10 1. Given a time in 12-hour AM/PM format, convert it to military (24-hour) time. 12:00:00AM
on a12-hour clock is 00:00:00 on a 24-hour clock. - 12:00:00PM on a 12-hour clock is 2:00:00
on a 24-hour clock. https://www.hackerrank.com/challenges/time-conversion/problem
2. Harry was studying a magic book that categorizes the magic spells into 3 categories - Good ,
Worst and Bad. If any spell contains all the vowels in alphabetical order then that spell is
categorized as Good. If it contains the vowels in reverse alphabetical order , then that spell is
categorized as Worst. All the other spells that do not fall in any of the categories before are
categorized as Bad. Now Harry tries to evaluate himself by solving a spell categorization
exercise at the end of the book , but since he is confused can you help him by solving the
problems. https://www.hackerearth.com/practice/algorithms/string-algorithm/basics-of-
string-manipulation/practice-problems/algorithm/master-cf6dadd7/
3. Two strings A and B comprising of lower case English letters are compatible if they are equal
or can be made equal by following this step any number of times: Select a prefix from t he
string A(possibly empty), and increase the alphabetical value of all the characters in the
prefix by the same valid amount. For example, if the string is xyz and we select the prefix xy
then we can convert it to yz by increasing the alphabetical value by 1. But if we select the
prefix xyz then we cannot increase the alphabetical value.Link:
https://www.hackerearth.com/practice/algorithms/string-algorithm/basics-of-string-
manipulation/practice-problems/algorithm/aliceandstrings-9da62aa7/
4. Let's Review: Given a string, S, of length N that is indexed from 0 to N-1, print its even-
indexed and odd-indexed characters as 2 space-separated strings on a single line (see the
Sample below for more detail). 0 is considered to be an even index
https://www.hackerrank.com/challenges/30-review-loop/problem
11 1. Small Triangles, Large Triangles (single Structure pointer point to array of structures)
https://www.hackerrank.com/challenges/small-triangles-large-triangles/problem
2. . Boxes through a Tunnel
https://www.hackerrank.com/challenges/too-high-boxes/problem
3. In college competition principal has given one game, around 10 students played the game,
their scores will be [34,54,87,59,14,37,48,15,79,65,65] when it comes to prize distribution,
principal told that I would give the prize who secure 2nd place. Help the principal to find the
student to give prize. Using structure pointer.
12
13 1. Given the pointer to the head node of a linked list and an integer to insert at a certain position,
create a new node with the given integer as its data attribute, insert this node at the desired
position and return the head node. A position of 0 indicates head, a position of 1 indicates
one node away from the head and so on. The head pointer given may be null meaning that
the initial list is empty. https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-
position-in-a-linked-list/problem
2. You are given the pointer to the head node of a sorted linked list, where the data in the nodes
is in ascending order. Delete nodes and return a sorted list with each distinct value in the
original list. The given head pointer may be null indicating that the list is empty.
https://www.hackerrank.com/challenges/delete-duplicate-value-nodes-from-a-sorted-linked-
list/problem
3. Remove Friends https://www.hackerearth.com/practice/data-structures/linked-list/singly-
linked-list/practice-problems/algorithm/remove-friends-5/