Starting Vocational Training From 1-May-2024 Get Detail


C language

Function
1.

Menu driven program for addition,substraction,multiplication and division.


Solution
2.

Write a program in C to print all perfect numbers in given range using the function. 
Test Data : 
Input lowest search limit of perfect numbers : 1
Input lowest search limit of perfect numbers : 100
Expected Output :

 The perfect numbers between 1 to 100 are :                                      
 6   28  

Solution
3.

Write a program in C to check armstrong and perfect numbers using the function. 
Test Data : 
Input any number: 371 
Expected Output :

 The 371 is an Armstrong number.                                                 
 The 371 is not a Perfect number.  

Solution
4.

Write a program in C to check whether a number is a prime number or not using the function. 
Test Data : 
Input a positive number : 5 
Expected Output :

The number 5 is a prime number. 

Solution
5.

Write a program in C to convert decimal number to binary number using the function. 
Test Data : 
Input any decimal number : 65 
Expected Output :

 The Binary value is : 1000001 

Solution
6.

Write a program in C to find the sum of the series 1!/1+2!/2+3!/3+4!/4+5!/5 using the function. 


Solution
7.

Write a program in C to check a given number is even or odd using the function.


Solution
8.

Write a program in C to swap two numbers using function. 
Test Data : 
Input 1st number : 2 
Input 2nd number : 4 
Expected Output :

Before swapping: n1 = 2, n2 = 4                                                  
After swapping: n1 = 4, n2 = 2 

Solution
9.

Write a program in C to show the simple structure of a function to add given two numbers.


Solution
10.

Write a program in C to find the square of any number using the function.


Solution