C Problem
C Problem
Page 1 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
>=60 First
50-59 Second
40-49 Third
<40 Fail
Question B10: An electricity board charges according to the following rates:
For the first 100 units - 40 paisa per unit.
For the next 200 units - 50 paisa per unit.
beyond 300 units - 60 paisa per unit.
All users are charged meter charges also, which are Rs. 50/-
Question B11: WAP to input monthly salary from the user and calculate the income tax according to the following rules:
Salary income tax
>=9000 40% of the salary
7500-8999 30% of the salary
<7500 20% of the salary
Question B12: WAP to input the selling price and cost price from the user and determine whether the seller has made profit or
incurred loss. Also display the value of profit or loss.
Question B13: WAP to input a character and check that it’s a small letter, capital letter, a digit or a special symbol.
Question B14: WAP to input two integers and determine that first is multiple of second.
Question B15: WAP to input a character and check that it’s a vowel or a consonant.
Question B16: WAP to convert a small letter into capital letter and vice versa.
Question B17: WAP to input the marks of a student in five subjects and calculate the grade according the following conditions:
Marks Grade
>90 S
76-90 A
61-75 B
51-60 C
40-50 D
<40 Fail
Question B18: WAP to input the sales made by a salesman and calculate the commission according to the following conditions:
Sales Commission
1-10000 4%
10001-20000 5%
20001-30000 6%
>30000 7%
Question B19: WAP to convert the temperature according to the following conditions:
Choice Conversion
1 Fahrenheit to Celsius
2 Celsius to Fahrenheit
Question B20: WAP to find out the largest of three numbers.
Question B21: WAP to input three numbers and print them in descending order.
Question B22: WAP to input a number (1 to 7) and print the weekday name according to the given number.
Question B23: WAP to input a digit and print the digit in words.
Question B24: WAP to input two numbers and a choice and calculate the result according to the following conditions:
Choice Result
1 Add
2 Subtract
3 Multiply
4 Divide
5 Remainder
Question B25: WAP to input two numbers and an operator and calculate the result according to the following conditions:
Operator Result
‘+’ Add
‘-‘ Subtract
‘*’ Multiply
‘/’ Divide
‘%’ Remainder
Question B26: WAP to calculate the area of a circle, a rectangle or a triangle depending upon user’s choice.
Choice Area
1 Circle
2 Rectangle
3 Triangle
Page 2 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
Question B27: WAP to input the marks in theory and practical and print the result.
Question B28: WAP to input a date (dd / mm / yyyy) and check for the validity of the date.
Question B29: WAP to print counting from 1 to 10.
Question B30: WAP to print counting from 10 to 1.
Question B31: WAP to print counting from 51 to 90.
Question B32: WAP to find out the sum and average of all the numbers within the given range.
Question B33: WAP to print all the numbers falling between 2 numbers entered by the user.
Question B34: WAP to print all the even numbers between 1 and 50.
Question B35: WAP to print all the odd numbers between 1 and 50.
Question B36: WAP to print the sum and average of first n natural numbers.
Question B37: WAP to print the sum and average of first n odd numbers.
Question B38: WAP to print the sum and average of first n even numbers.
Question B39: WAP to print the table of a given number.
Question B40: WAP to input 2 numbers and find out the sum of all the even numbers which are not divisible by 5 but divisible
by 3 and lies between the given two numbers.
Question B41: WAP to input the name and age of a person and print the name as many times as age.
Question B42: WAP to print whole screen with any character.
Question B43: WAP to print the factorial of a given number.
Question B44: WAP to input a number through the keyboard until a ‘.’. Every time a number is entered. The program should
display whether it is greater than, less than or equal to the previous number.
Question B45: WAP to check that given number is prime or not.
Question B46: WAP to input a number and count its even and odd digits and find out their sum separately.
Question B47: WAP to generate divisors of an integer.
Question B48: If a number 972 is entered through the keyboard, your program should print “Nine Seven Two”. Write the
program such that it does this for any positive integers.
Question B49: A positive integer is entered through the keyboard, along with it the base of the numbering system in which you
want to convert this number. WAP to display the number entered, the base and the converted number.
Question B50: WAP to input a number and separate the number in its individual digit and print the digits separated from one
another by three spaces each.
Question B51: WAP to convert a decimal number to equivalent binary number (fractions also).
Question B52: WAP to convert a decimal number to equivalent octal number.
Question B53: WAP to convert a decimal number to equivalent hexadecimal number.
Question B54: WAP to convert a binary number to the decimal number.
Question B55: WAP to convert a octal number to the decimal number.
Question B56: WAP to convert a hexadecimal number to the decimal number.
Question B57: WAP to convert a octal number to binary number.
Question B58: WAP to convert a hexadecimal number to the binary number.
Question B59: WAP to generate all combinations of 1, 2 and 3.
Question B60: WAP to find out the LCM and GCD of two given numbers.
Question B61: WAP to find out the least common divisor of two integers.
Question B62: WAP to check whether square root of a number is prime or not.
Question B63: WAP to find out the sum of the following series:
(1) 1 + x2/2! + x4/4! + x6/6! + …….xn/n!
(2) 1 - x2/2! + x4/4! - x6/6! + …….xn/n!
(3) 1 + 1/1! + 1/2! + 1/3! + …….
(4) 1 + 1/1! + 2/2! + 3/3! + …….
(5) x + x2/2! + x3/3! + x4/4! + …….xn/n!
(6) x - x2/2! + x3/3! - x4/4! + …….xn/n!
(7) 1 + 1/x + 1/x2 + 1/x3 + 1/x4 +………..
(8) x – x3/3! + x5/5! – x7/7! + x9/9! -…….xn/n!
(9) 1- 2/21 + 3/31 – 4/41 + 5/51……….
(10) 1 + x1/2! + x2/3!...................+ x N/(N+1)!
(11) 1 + x/2! + x2/4! + x3/6! + x4/8! +………..xn/(2n)!
(12) 1 + x/1! + x3/2! + x5/3! + x7/4! +………..x2n-1/n!
(13) 1 + x2/1! + x4/2! + x6/3! + x8/4! +………..x2n/n!
(14) 1 - x2/2! + x3/3! – x4/4! + …….xn/n!
(15) 1 + x2/2! + x3/3! + x4/4! + …….xn/n!
(16) x + x2/3! + x3/5! + x4/7! + x5/9! +…….xn/(2n-1)!
(17) x + x3/2! + x5/3! + x7/4! + x9/5! +…….x2n-1/n!
(18) x - x2/3! + x3/5! - x4/7! + x5/9! -…….xn/(2n-1)!
(19) a + ar + ar2 + ar3+…………+ar(n-1)
Page 3 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
Question B64: Input two numbers from the keyboard. Write a program to find the value of one number raised to the power of
another.
Question B65: WAP to print all the ASCII values and their equivalent characters. The ASCII values vary from 0 to 255.
Question B66: WAP to check that given number is Armstrong number or not. ( if the sum of the cubes of each digits of the
number is equal to the number itself, then the number is called the Armstrong number. For example, 153 = (1*1*1) + (5*5*5) +
(3*3*3).
Question B67: 145 is a special number, since it satisfies the following relation:
145 = 1! + 4! + 5! = 1+24+120 =145
WAP to print all the numbers of this kind between 1 – 1000000.
Question B68: WAP to find out the sum of geometric series.
Question B69: WAP to print out all Armstrong numbers between 1 and 500.
Question B70: Square of 12 is 144. 21, which is a reverse of 12 has a square 441, which is same as 144 reversed. There are few
numbers which have this property. Write a program to find out whether any more such numbers exist in the range of 10 to 100.
Question B71: WAP to find out the difference between two dates in terms of numbers of days.
Question B72: WAP to input n numbers and calculate the sum, average, maximum and minimum of the given numbers. (use only
one variable to input the number and also find the second largest).
Question B73: WAP to print the sum of negative numbers, sum of positive even numbers and sum of positive odd numbers from
a list of numbers entered by the user.
Question B74: WAP to print the largest even number and largest odd number from the list of numbers entered through keyboard.
Question B75: WAP to determine all Pythagorean triplets in the range 100 to 1000.
(A Pythagorean triplet is a set of three integers i, j, k such that i2 + j2 = k2)
Question B76: WAP to print the following series:
(1) 2, 4, 8, 16, 32, 64, 128, 256
(2) 1, 4, 7, 10, …………… 40
(3) 1, -4, 7, -10……………-40
(4) 1, 5, 11, 19, 29 ……..
(5) (1) + (1+2) + (1+2+3) + (1+2+3+4) …………. up to n terms
(6) (2) + (2+4) + (2+4+6) + (2+4+6+8) …………. up to n terms.
(7) (1) + (1+3) + (1+3+5) + (1+3+5+7) …………. up to n terms
(8) (12) + (12+32) + (12+32+52) + (12+32+52+72) ……. up to n terms
(9) (22) + (22+42) + (22+42+62) + (22+42+62+82) ………up to n terms
(10) (13) + (13+33) + (13+33+53) + (13+33+53+73) ……. up to n terms
(11) (1/1!) + (2/3!) + (3/4!) + (4/5!) + (5/6!) ……. up to n terms
(12) log1 + log4 + log 9 + log16 + log25 + ….……. up to n terms
(13) log1 + log8 + log 27 + log64 + log512 + ….……. up to n terms
Question B77: WAP to calculate the root of quadratic equation.
Question B78: Write a menu driven program which has following options:
1. Factorial of a number.
2. Prime or Not
3. Odd or even
4. Exit.
Question B79: WAP to input a number and print its reverse number. Also check that the number is palindrome or not.
Question B80: WAP to input a number and find out the sum of its digits.
Question B81: WAP to find out the count of the digits of a given integer.
Question B82: WAP to print the Fibonacci series.
Question B83: WAP to input a name and print the name in the following pattern
R RAJAT
RA RAJA
RAJ RAJ
RAJA RA
RAJAT R
1234 4444
123 333
12 22
1 1
Page 4 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
5
54
543
5432
54321
A A
AB BB
ABC CCC
ABCD DDDD
ABCD DDDD
ABC CCC
AB BB
A A
* ****
** ***
*** **
**** *
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
0
1 0 1
1 0 1 0 1
1 0 1 0 1 0 1
1 0 1 0 1 0 1 0 1
0
1 0 1
2 1 0 1 2
3 2 1 0 1 2 3
4 3 2 1 0 1 2 3 4
A
A B A
A B C B A
A B C D C B A
A B C B A
A B A
A
Page 5 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
Page 6 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
Question D22: WAP to check that given array is sorted in ascending / descending order.
Question D23: WAP to search a value in the array using
(1) Linear search technique.
(2) Using binary search technique.
Question D24: WAP to count the number of occurrences of a given number in an integer array.
Question D25: An array consists of 50 integers in the range of 1 to 25, write a program that prints the number of times each
integer occurs in the array.
Question D26: A, B, C are the arrays of integers of size a, b, a + b, Write a program to produce a third array C containing all the
elements of array A and B.
Question D27: WAP to merge two arrays according to the following conditions:
First array Second array Resultant array
(1) Ascending Ascending Ascending
(2) Ascending Ascending Descending
(3) Ascending Descending Ascending
(4) Ascending Descending Descending
(5) Descending Descending Ascending
(6) Descending Descending Descending
Question D28: WAP to add and multiply two large integers, which cannot be represented by built in data types.
Question D29: WAP to delete all elements in between and occupying two specified positions.
Question D30: WAP to search the first occurrence a given sub array within another array.
Question D31: WAP to merge 4 arrays a, b, c, d in one array. All the arrays are in ascending order.
Page 7 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
Page 8 of 9
Dept. of CSE, AUST (Elementary Structured Programming)
Page 9 of 9