Lecture 18 – Functions (continued)
Let’s see how we can write a function which takes an argument but does not return a value. Type 3 – Functions that take argument and returns nothing Let’s work with another type in which 1. Main function will take input from the user 2. Pass that value to the called function 3. The called function will calculate its square 4. The called function will display the calculated value on screen #include <stdio.h> #include <conio.h> void square(int number) { Output Please enter a number: 5 The square is 25 number = number * number; printf(”\nThe square is %d ”,number); } void main() { int result, input_value; clrscr(); ...