

This course is designed for individuals who are new to programming and want to master the C Programming Language. The course aims to introduce the problem statements various coding platforms such as Hackerrank, GeeksforGeeks, leetcode, etc and include concepts of operators, control structures, functions, and arrays.
A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers are always displayed without leading zeros.
Input Format
The first line contains integer t,thenumber of test cases .Integers K are given in the next t lines.
Output Format:
For each K, output the smallest palindrome larger than K.
Input: 2
808
2133
Output: 18
2222
Print hollow diamond pattern using ‘*’. See examples for more details.
Input Format:
First line of input contains T - number of test cases. Its followed by T lines, each line contains a single odd integer N - the size of the diamond.
Input : 2
3
7
Output : Case #1: *
* *
*
Case #2: *
* *
* *
* *
* *
* *
*
Given 2 numbers, find their LCM and HCF. Note: Do not use any inbuilt functions/libraries for your main logic.
Input Format
First line of input contains T - number of test cases. Its followed
by T lines, each contains 2 numbers A and B.
Output Format
For each test case, print their LCM and HCF separated by space,
separated by newline
Constraints:
1 <= T <= 105
1 <= A,B <= 109
Input: 4
4 710
13 1
6 4
605904
996510762
Output: 1420 2
13 1
12 2
7740895599216
78
Given a number N, find the least palindromic number K, such that K>N.
Input Format
First line of input contains T - number of test cases. Its followed
by T lines, each contains a single number N.
Output Format:
For each test case, print the least palindromic number K, such
that K>N, separated by newline.
Input: 2
11
121
Output: 22
131
Given a number N, find the number of bits that are set to 1 in its binary representation.
Input: 15
Output: 4
Given a number, check if it is a power of 2.
Input Format
First line of input contains T - number of test cases. Its followed
by T lines, each line containing a single positive integer.
Output Format:
For each test case, print “True” or “False”, separated by new line.
Input: 5
1
8
10
25
512
Output: True
True
Given an array of size N, it contains all the numbers from 1 to N+1 inclusive, except one number. You have to find the missing number.
Input Format
First line of input contains T - number of test cases. Its followed
by 2T lines, first line of each test case contains N - size of the
array and the next line contains N integers - the elements of the
array.
Output Format:
For each test case, print the missing number, separated by
newline.
Input: 3
8
1 2 7 9 5 6 3 8
7
3 5 8 1 4 7 2
10
8 11 10 2 7 4 3 5
1 6
Output: 4
6
9
Given two numbers X and Y, find the number whose binary representation has X 1’s followed by Y 0’s.
Input: 4 3
Output: 120
You are given two numbers A and B. Write a program to count the number of bits to be flipped to change the number A to the number B. Flipping a bit of a number means changing a bit from 1 to 0 or vice versa.
Input: 20 10
Output: 4
Given 2 numbers - a and b, evaluate ab. Note: Do not use any inbuilt functions/libraries for your main logic.
Input: 5 2
Output: 24
Given an array of unique integer elements, print all the subsets of the given array in lexicographical order.
Input: 3 15 5
Output: 3
3 5
3 5 15
3 15
5
5 15
15
Given an array of size 3X+1, where every element occurs three times, except one element, which occurs only once. Find the element that occurs only once.
Input: 5 7 8 7 7 5 5 9 8 8
Output: 9
The Tower of Hanoi (also called the Tower of Brahma or Lucas’) is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules: Only one disk can be moved at a time. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack. No disk may be placed on top of a smaller disk. Your task is that given N disks, print the minimum number of moves required in order to solve the problem, followed by the actual moves. Assumptions
The rods are named A, B and C.
All the disks are initially placed on rod A.
You have to move all the disks from rod A to rod C.
Input: 1
3
Output: 1
Move 1 from A to
C
7
Move 1 from A to
C
Move 2 from A to
B
Move 1 from C to
B
Move 3 from A to
C
Move 1 from B to
A
Move 2 from B to
C
Move 1 from A to

About Course The course teaches beginners about computer systems with the permission of the …
Know More
About Course Course Syllabus INTRODUCTION AND DATA BASE DESIGN Database, Data models, Database …
Know More
About Course Course Syllabus Complexity analysis of Algorithms Algorithm definition, time complexity …
Know More