Skip to main content

4.) With argument and With return

In this type of function arguments and parameters must be passed to any function and function return a single value.The type of function depends up on the return value.
syntax:-
datatype of function name(datatype arg 1,datatype arg2)
{
statement;
...........
...........
return(exp);
}
                 
ex:-main()
{
int fact(int);
printf("\n factorial =%d",fact(5));
getch();
}
int fact(int n)
{
int f=1;
while(n>1)
{
f=f*n;
n--;
}
return(f);
}

Comments

Popular posts from this blog

Important links

  Software Drive https://drive.google.com/drive/folders/1siws7oga-10wdlPhOdcjamlDH6wm0iE_?usp=sharing PPT Drive https://drive.google.com/drive/folders/1lNHhZ4_qlsyHrWA862DyBSvkF_J4YVp8 https://docs.google.com/document/d/1fo_4gFB4sgWfTBfZvK7qf0LP0y9ge1dH/edit

Python Practice questions

Reverse  Check substring in string  Armstrong no or not Palindrome  Table print  Power of the no Factorial