1. Write a program in C to show the simple structure of a function. Expected Output : The total is : 11 2. Write a program in C to find the square of any number using the function.  Test Data : Input any number for square : 20 Expected Output : The square of 20 is : 400.00 3. 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1. Write a program in C to show the simple structure of a function.
Expected Output :
The total is : 11

2. Write a program in C to find the square of any number using the function. 
Test Data :
Input any number for square : 20
Expected Output :
The square of 20 is : 400.00

3. 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

4. Write a program in C to check a given number is even or odd using the function. 
Test Data :
Input any number : 5
Expected Output :
The entered number is odd.

5. 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. 
Expected Output :
The sum of the series is : 34

6. 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


7. 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.

8. Write a program in C to get the largest element of an array using the function. 
Test Data :
Input the number of elements to be stored in the array :5
Input 5 elements in the array :
element - 0 : 1
element - 1 : 2
element - 2 : 3
element - 3 : 4
element - 4 : 5
Expected Output :
The largest element in the array is : 5

9. 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.

10. 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


11. Write a program in C to check whether two given strings are an anagram. 
Test Data :
Input the first String : spare
Input the second String : pears
Expected Output :
spare and pears are Anagram.

12. Write a C programming to find out maximum and minimum of some values using function which will return an array. 
Test Data :
Input 5 values
25
11
35
65
20
Expected Output :
Number of values you want to input: Input 5 values
Minimum value is: 11
Maximum value is: 65

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY