Skip to content

Lab Practicals

Part A

Program 1 - Fibonacci Series

Printing Fibonacci Sequence
0 1 1 2 3 5 8 13 21 34

Code

Program 2 - Prime Number Checker

Enter the Number to check Prime: 23
Number is Prime.
Enter the Number to check Prime: 17
Number is Prime.

Code

Program 3 - Palindrome checker

Enter the Number: 121
Number is Palindrome.
Enter the Number: 156
Number is not Palindrome.

Code

Program 4 - Factorial Finder

Enter the Number: 6
Factorial of 6 is: 720

Code

Program 5 - Sum Of Digits

Enter the Number: 23
Sum of Digits is: 5

Code

Program 6 - Reverse of a Number

Enter a number: 
53432
Reverse of the number is 23435

Code

Program 7 - Swap Two Numbers without 3rd Variable

Enter the first number: 
45
Enter the second number: 
2
Before swapping: num1 = 45 num2 = 2
After swapping: num1 = 2 num2 = 45

Code

Program 8 - Print a Pascal Triangle

Enter the number of rows: 
5
    1 
   1 1 
  1 2 1 
 1 3 3 1 
1 4 6 4 1

Code

Program 9 - Demonstrate Multithreaded Programming

Thread Name: Main Thread
Currently Executing Thread: Main Thread

Code

Program 10 - Find Square using Subroutines and Functions

Enter a number: 
5
Square of the number is 25

Code

Source:

  • General Questions were found in Syllabus