For N = 9, output is 1, 3, 9
For N = 7, output is 1, 7
click here
16.Write a C Program to calculate the power of a number, given the number and the exponent.
Click here for program
17.Multiply all the digits of a number n by each other, repeating with the product until a single digit is obtained. The number of steps required is known as the multiplicative persistence, and the final digit obtained is called the multiplicative digital root of n. For example, the sequence obtained from the starting number 9876 is (9876, 3024, 0), so 9876 has a multiplicative persistence of two and a multiplicative digital root of 0. Write a C Program to for finding number persistency and multiplicative root of any positive integer n.
click here
18.Write a C Program that prompts the user for a positive integer as input, printing the respective hollow triangle
CLICK HERE
19.Write a C program that prints an equilateral triangle for a given n.
For n=3
*
**
***
**
*
For n=4
*
**
***
****
***
**
*
CLICK HERE
20.Ramanujan Number is the smallest number expressible as the sum of two cubes in two different ways. The two different ways are these:
1729 = 13 + 123 = 93 + 103
The second such number is 23 + 163 = 93 + 153 = 4104. Sequences of such numbers are called Taxicab numbers. Write a C program that print first n taxicab numbers (provided n > 0).
click here
21:Mr. Bhola is fed-up of giving individual dates as inputs. He wants a complete calendar starting from 1st January to 31st December for a given year.
Write a C program that takes input as a int in format yyyy.
CLICK HERE
22:Write a C program that solve the n-ball problem; given any number of balls, you have to tell how many times you have to weigh at minimum to find which ball is the heavier one. Also your code should display the 3 splits of n balls. Make sure that your code handles properly all values of n, not only those that are multiples of 3.
For n=8, min_weigh = 2 and pan1=3, pan2=3, remaining=2.
For n=13, min_weigh = 3 and pan1=5, pan2=5, remaining=3.
CLICK HERE
23.CS102 students loves to read the book of pscp but they are facing difficulties in searching the book
in library, as the book are placed by related fields in library not by course name so it is hard to
search the book manually, the solution of this problem is suggested to have such “search program”
that takes the isbn number of book find whether the book is available or not and tells Its edition,
price , Write a search program that search the availability of book its Edition ,ISBN and price .
Hints:
1. Consider the following table for example
CLICK HERE
24.Write a program that count the occurrence of each element in an int array
of size 25
Sample Input: 1 13 1 4 20 5 1 5 13 1 5 20 4 3 5
Sample Output:
occurrence of 1 : 4
occurrence of 13 : 2
occurrence of 4 : 2
occurrence of 20 : 2
occurrence of 5 : 4
occurrence of 3 : 1
CLICK HERE
25.Write a program that tests equality of two array of size , suppose there are
two int array, The program should say “yes” if every element of first array is equal to the
corresponding element of second array, other wise no if at least one element is not equal .
Sample Input: First_Array 1 13 1 4 20 5
Second_Array 0 13 1 4 20 5
Sample Output: NO
Sample Input: First_Array 1 13 1 4 20 5
Second_Array 1 13 1 4 20 5
Sample Output : Yes
CLICK HERE
26.Write a C program to keep records and perform statistical analysis for a
class of student. The class may have up to 5 student . There are five quizzes during the term. Each
student is identified by a four-digit student number. The program will print the student scores and
calculates and print the statistics(high score,low score and average score ) for each quiz . The output
is in the same order as input ; no sorting is required .
CLICK HERE
27.Create a fraction calculator that takes input of two fraction and perform
the operation select by the user
First create two char array that is used to take the input in fraction from user and then user input the
operation to be performed like (+,-,/,*). your program should print the menu like below
Sample Input: Enter The first fraction value : 2/5
Sample Output: Enter The second Fraction Value : 2/5
28.
Write a program that reads full names, one per line, and then prints them inthe standard telephone directory format. For example,
Sample Input1: George Frederic Handel
Sample Output1: Handel, George F.
Sample Input2: Joseph Haydn
Sample Ouput2: Haydn, Joseph
Sample Input3: Johann Christian Bach
Sample Output3: Bach, Johann C.
Your program should ask user name and print output repeatedly till user press any sentinel value
(you may select any sentinel here)
click here
29.Write a C program to delete the all vowels from a user-entered string. You
are required to delete the vowels from the string. Just not printing them is not a valid answer.
Sample Input1:Hello World (String Length=11)
Sample Output1: Hll Wrld (String Length=8)
Sample Input2: Apple (String Length=5)
Sample Output2:ppl (String Length=3)
click here
30.A string is said to be complete if it contains all the characters from a to z.
For a user-entered string, check if it is complete or not.
Sample Input: The quick brown fox jumps over a lazy dog
Sample Output: The entered string is complete.
CLICK HERE
31.Write a C program to find a sub-string in a string.
Sample Input: you just blew my mind
Substring to search: my
Sample Output: Substring found.
click here
32.Write a C program to convert numeric string to an int of same value?
For Example, if you read a string “1524” then an integer variable in your program should be
assigned 1524 as an integer.
CLICK HERE
No comments:
Post a Comment