You are on page 1of 4

Basic Programme Of C/C++/python/java:-

Q1. Addition of two numbers


Q2. Subtraction of two numbers
Q3. Multiplication of two numbers
Q4. Division of two numbers
Q5. Square of a number
Q6. Cube of a number
Q7. Find Area of triangle
Q8. Find Area of square
Q9. Find Area of circle
Q10. Volume of cylinder
Q11.Convert time into minute, hour and second
Q12 Convert distance into feet to inches and inches into feet
Q13 Read temperature fahrenheit to Celsius and Celsius to fahrenheit c=(f-32)/1.8
Q14 Find square root of a number
Q15 Find the simple interest
Q16 Find the compound interest ci=p*(1+r/100)t
Q17 Find area of triangle tr = sqrt(s(s-a)*(s-b)*(s-c) ,s= (a+b+c)/2.
Q18 Evaluate: x= ((a+b)*(c-d))/(a+d)).
Q19 Read two no. and swap each other with third variable and without third variable.
Q20 Evaluate: y = (a2+b3) / (a-b).
If/Else, Multiple If Else, Switch Case
Q1. WAP to find bigger of 2 values
Q2. WAP to find smaller of 2 values
Q3. WAP to smallest of 3 values
Q4. WAP to find biggest of 4 values
Q5. WAP to check number is odd/even
Q6 WAP to check year is leap or not
Q7 WAP to input a number and check it is negative / positive
Q8 WAP to input marks and check student is pass or fail
Q9 WAP to input salary and calculate bonus if salary<5000 then bonus is 500 else bonus is 1000
Q10. WAP to input units and calculate rent if units <500 rent is 2rs/call else 2.50/call
Q11. WAP to input a number if number is negative find square else find cube of the number
Q12. WAP to input a number if it is divisible by 3 find its cube else find power 4
Q13. WAP to input a number if it is divisible by 3 or 5 find square else find its square root
Q14. WAP to input calls if calls<200 rent is 1.80/call if calls b/w 200-500 rent is 1.60/call else 1.50/call add 7%
tax
Q15. WAP to input salary calculate HRA, DA, total salary if salary <5000 HRA is 5% of salary and DA is 7%
of salary if salary between 5000-10000 HRA is 6% of salary and DA is 8% salary calculate total salary.
Q16. Calculate area on user’s choice if ch=1 calculate area of circle, if ch=2 calculate area of square, if ch=3
calculate area of triangle, if ch=4 calculate area of rectangle (Also by Switch case)
Q17. WAP to calculate volume on user’s choice volume of cylinder, sphere, cone (Also by Switch case)
Q18. WAP to input a number if number is divisible by 2 find square of the number, if number is divisible by 3
find its cube if number is divisible by 5 find power 5
Q19. WAP to input a character and check it is capital, small, digit or special character
Q20. WAP to input a character and convert its case
Q21. WAP to input a digit and print in words (Also by switch case)
Q22 WAP to input a month in digit and print in words (Also by switch case)
Q23 WAP to input day in digit and print in words (Also by switch case)
Q24.WAP to create a program for MCQ (Multiple choice questions) test.
Q25. WAP to input 3 numbers and print them in ascending order
For Loop Questions
Print the following series
Q1. 1 2 3 4 5 6 7 …………n
Q2. 2 4 6 8 10 12 14 ……...n
Q3. 51 46 41 36 31 ………..1
Q4. 1 4 9 16 25 36 49
Q5 1 2 4 8 16 32 64
Q6 1 -2 3 -4 5 -6 7
Q7 x^1 + x^2 + x^3 ………………x^n
Q8 2!/X^2 + 3!/X^3 + 4!/X^4……………
Q9 2X/3! - 3X/4! + 4X/5! ……………..
Q10 1 2 4 5 7 8 10 11 13
Q11 1 3 6 10 15 21 28 36
Q12 11/43 13/40 15/37 17/34………………….
Q13 1 -4 7 -10 13 -16 19 -22
Q14 32 16 8 4 2 1
Q15 1 -x^2 + X^3 -X^4
Find the sum of the series
Q16 1 -2 3 -4 5 -6 7
Q17 x^1 + x^2 + x^3 ………………x^n
Q18 2!/X^2 + 3!/X^3 + 4!/X^4……………
Q19 2X/3! - 3X/4! + 4X/5! ……………..
Q20 1 2 4 5 7 8 10 11 13
Q21 1 3 6 10 15 21 28 36
Q22 11/43 13/40 15/37 17/34………………….
Q23 1 -4 7 -10 13 -16 19 -22
Q24 32 16 8 4 2 1
Q25 1 -x^2 + X^3 -X^4
Q26 print Fibonacci series
Q27 calculate factorial of a number
Q28 print table of a number
Q29 print reverse table of a number
Q30 print factors of a number
Q31 check number is prime or not
Q32 sum of n natural number
Q33 sum of squares of n natural number
Q34 input a number if negative, print forward table else, print reverse table.
While / Do While Question
Q1. Reverse a number
Q2. Palindrome number checking
Q3. Armstrong number checking
Q4. Mystic number checking
Q5. Sum of digits of a number
Q6 Product of digits of a number
Q7 Sum of squares of digits of a number
Q8. WAP to print the biggest digit of a number
Q9. WAP to print the smallest digit of a number
Q10. WAP to find average of digits of a number
Q11. WAP to find sum of alternate digits of a number
Arrays:
Q1. Input one dimensional array elements of 5 students and display them.
Q2. Find sum and average of 10 students marks.
Q3. Find max and min of 10 array elements.
Q4. Find square of each element of 5 elements in one-dimensional array .
Q5. Find factorial of 6 elements in one-dimensional array.
Q6. Count prime numbers in one-dimensional array.
Q7. Print double of each element in one-dimensional array.
Q8. Print table of each element in one-dimensional array.
Q9. Print even and odd elements of one-dimensional array.
Q10.Print reverse of 6 array elements of an array.
Q11.WAP to find sum of cubes of all array elements of an array.
Q12.WAP to search an array element in the given array of 5 elements.
Q13.WAP to accept 10 array elements and display the sum of highest and lowest elements.
Q14.WAP to sort an array of 7 elements through selection sort/linear sort.
Q15.WAP to sort an array of 10 elements through bubble sort.
Q16.WAP to sort an array of 5 elements through binary sort.
Q17.WAP to find second highest element of an array of 5 elements.
Q18.Diplay array elements of a matrix of 2-dimensional array.
Q19.WAP to print only even numbers of 2-dimensional array.
Q20.WAP to count even numbers in 2-dimensional array.
Q21.Print max element from 2-dimensional array.
Q22.Print negative and positive elements of 2-dimensional array.
Q23.WAP to find sum of matrix of 2-dimensional array.
Q24.WAP to do sum of diagonal of matrix of 2-dimensional array.
Q25.WAP to find sum of elements of lower triangle of matrix in 2-dimensional.
Q26.WAP to find sum of upper triangle of matrix in 2-dimensional.
Q27.Converting of 2-dimensional array into one-dimensional array.
Q28 Converting one-dimensional array into 2-dimensional array.
Q29WAP to print sum of 2 matrixes in third one.
Q30.WAP to check whether 2 matrixes are symmetric or not in 2-dimensional array.
Q31WAP to find transpose of a matrix.
Q32.WAP to print all duplicate from an ordered array of 8 elements
eg.input {1,1,4,8, 8,12,15,15}
output will be 1,8,15
Structure:
Q1.WAP to create structure of employee having members’ name,employee id,age.Create two objects E1,E2.Assign and access values.
Q2.WAP to create structure of 3 books having name,price,pages.Create 3 objects b1,b2 and b3.
Q4.WAP to input details of the student and print detail of the student having max marks.
Q5.WAP to input details of two bank customers includes name,balance amount and account number .The program will add and
display updated balance of both customers by adding 5% interest.
Q6.WAP to input employee record including employee number,employee name and salary. Display record and calculate gross-salary
and net-salary if salary is less than 15000 then house rent allowance is 30% and dearness allowance is 35% and if salary is
greater than or equal 15000 then dearness allowance is 25% and house rent allowance is 30%.
Q7.WAP to input details of 5 students having roll number,name and marks.Display detais of all of the students and search record for a
particular student.
Q8.WAP to input details of 5 employees of a company including id,name,age and salary .Find out maximum salary of a employee.
Q9.WAP to accept employee no,age and salary of five workers and sort their names according to their age.
Q10.Print name alphabetically in structure of 5 students.

String:
Q1.WAP to count length of string without using string libray function.
Q2.WAP to count no of vowels in a string.
Q3.WAP to count no of spaces in a string.
Q4.WAP to convert each character of a string into next third characters.
Q5.WAP to sort the given string .
Q6.WAP to count no. of words in a string.
Q7.WAP to check whether a given string is palindrome or not.
Q8.WAP to count frequency of each character in a string.
Q9.WAP to count of any one character in a string.
Q10.WAP to remove extra spaces from a string.
Q11.WAP to print even and odd character in a string.
Q12.WAP to find out password in a string.
Q13.WAP to find substring in a string.
Q14.WAP to print any name and print first capital letter of this name like:
Input-Mohandas Karamchand Gandhi
Output-M.K.G.
Q15.WAP to compare two strings which are given as input and print the alphabetically greater.
File Handling
Q1.WAP to read contents of a file and to count capital letters from a file.
Q2.WAP to copy a file into other file.
Q3.WAP to copy capital letters only from a given file into a separate file.
Q4.WAP to handle mixed data types.
Q5.WAP to count no. of lines in a file using I/O string in a file.
Q6.WAP to count no of lines which have more than 5 vowels.
Q7.WAP to append one file at the end of another.
Q8.WAP to create a sequential file that could store details about five products.
Detail include product code,cost and number of items available and are provided through keyboard.
Q9.WAF to print MCQ (Multiple Choice Questions)including three students’ detail having rollno,name and marks in a file if we enter
1 then search a particular student’s detail by rollno,if we enter 2 then search a particular student by name and if 3 is entered,
then append a file at the end of another.
Q10.WAP which last character is ‘z ‘ in a file.
Q11.WAP to count no.of lines starting with ‘a’ in a file.

You might also like