Skip to main content

3.) No argument and with return

In this type of function,parameter and argument are not passed to any f\unction and function must return a value.So the datatype of function depends up on the datatype of return value of the function.
syntax:-
datatype function name()
{
statement;
..........
................
return(exp);
}
             
* Ex:-
void main()
{
int x;
int sum();
x=sum();
printf("\n sum=%d",x);
getch();
}
int sum()
{
int a,b,c;
printf("\n enter two number");
scanf("%d%d",&a,&b);
c=a+b;
return(c);
}

Comments

Post a Comment

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