Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 501 Bytes

File metadata and controls

24 lines (19 loc) · 501 Bytes

Assignment 1: Add Two Numbers Using a Function

Objective

Write a C program that reads two integers and prints their sum by calling a user-defined function.

Requirements

  1. Declare a function prototype named add.
  2. Define the add() function.
  3. Read two integers in main().
  4. Call add() from main().
  5. Print only the returned result.

Sample Input 10 20

Sample Output 30

Marks

  • Function definition: 2
  • Function call: 2
  • Compilation: 2
  • Visible test: 2
  • Hidden tests: 2