Skip to main content

2.) With argument and No return

In this type of function argument and parameter must be specified and function doesn't return any value so the datatype of function must be "void"
syntax:-
void function name(datatype arg 1,datatype arg 2)
{
statement;
.........
..........
}
example:-write  a program to input 3 number and calculate sum using function with argument and no return.
         
Ex:-
void main()
{
int a,b,c;
void sum(int,int,int);
printf("\n enter three number");
scanf("%d%d%d",&a,&b,&c);
sum(a,b,c);
getch();
}
void sum(int x,int y,int z)
{
int add;
add=x+y+z;
printf("\n sum of three number=%d",add);
}

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