Practical Tutorial

FOP Practical List

1.  Write a program to print “Hello World” message.    
2.  Write a program to print Name, Address and Birth Date.   
3.  Write a program to add, multiply and divide two integers
     and float numbers.   
4.  Write a program to convert Rupees (float) to Paisa (int).   
5.  Write a program to accept number of days and print year,
     month and remaining days.   
6.  Write a program to enter Number of seconds and display as
     Hours :______Minutes:______ Seconds : ______   
7.  Write a program to interchange the value of two numbers
     with and without third variable.   
8.  Write  a  program  to  find  the   size  (in bytes )  of  primary 
     Data  types. Also find the  minimum  and  maximum value 
     that  can  be  stored in  that  data  type.   
9.  Write  a  program  that  accept  basic,  HRA,  and  convergence 
     from  the  user  and calculate total salary.   
10. Write a program to check whether the entered number is even or odd.   
11. Write a program to find out the Maximum from given three numbers.   
12. Write a program to find out the Maximum from given three numbers.
      (Using Conditional Operator)   
13. Write a program to change case of character inputted by
      User and print tell that is it vowel or consonant.   
14. Write a program that takes input of year in 4 digits (i.e. 2010).
      Determine whether the year is leap year or not.   
15. Write a program to find the roots of an equation ax2 + bx + c = 0.   
16. Write a program that count the area for circle, square, rectangle
    and triangle using Switch-Case control structure   
17. Write a program that take input of 5 subjects marks. Count
      the percentage. Print the result for following condition
      If student has 70% or more then 70% then DISTINCTION.
      If student has percentage between 60 and 69 then FIRST CLASS.
      If student has percentage between 50 and 59 then SECOND CLASS.
      If student has percentage between 40 and 49 then PASS CLASS.
      If student has percentage less than 40 then FAIL.    
18. Using While loop print 1 2 3 4 5 …..10.    7/10/2010
19. Using For loop print series 2, 4, 6, 8,…….n.    
20. Print series 2, 4, 16,……n*n using shorthand operator and while loop   
21. Write a program to generate Fibonacci series using Do While loop.   
22. Write a program to print the multiplication table.   
23. Write a program to find a factorial of the entered number.   
24. Write a program to print all the numbers and sum of all the integers
      that are greater than 100 and less than 200 and are divisible by 7.    
25. Find out the G.C.F.  And L.C.M. of given two numbers.   
26. Write a program to check whether the entered number is
      Prime or not.   
27. Write a program to check whether the entered number is
      Perfect or not.   
28. Write a program to check whether the entered number is
      Armstrong or not.   
29. Write a program that prints the following
4
4 3
4 3 2
4 3 2 1

30. Print the following triangle.
a b c d e
a b c d
a b c
a b
a

31. Write a program that prints the following Floyd’s triangle.
1
2 3
4 5 6

32. Write a program that prints the following
2 4 6 8
4 6 8
6 8
8


Note: Program No: 29 to 32 Should be done with different alignment (Left, Center, and Right)

33. Write a program that prints the following
1
3
5 6
8 9 10

34. Write a program that prints the following
1 2 3 4 5 4 3 2 1
1 2 3 4    4 3 2 1
1 2 3          3 2 1
1 2                2 1
1                      1

35. Write a program to find max and min element from 1-D array.

36. Write a program to sort given array in ascending and descending order.
(as per user choice)

37. Given the two 1-D arrays A and B, which are sorted in ascending order.
Write a program to merge them into a single sorted array C that contains
every item from arrays A and B, in ascending order.

38. Write a program to Add, Subtract, and Multiply two Matrices. (Menu Driven)