Functions: -
A function self contained subprogram that
is meant to do some specific, well define task. C program consist of 1 or more
function. A program has only one function then it must be only the main()
function.
C programs have two type a functions.
1. Library
function
2. User
defined function
Library function:-
C has the function to provide
library function for performing some operation. these function are present in C
library and they are predefined
Example:- square(), power(), printf(), scanf()
and so on.
Question:- write a
program to find square root of any number
Example:- square(), power(), printf(), scanf() and so on.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # include<studio.h> # include< conio.h> # include< math.h> void main() { clrscr(); int n,s; Printf(" enter any number"); Scanf(" %d",&n); s = square(n); Printf(" the result is =%d",s); getch(); } |