100% prog to add numbers using functions
/*in this program we need not write function prototyping as we are directly defining the function in advance to the main()*/
#include<stdio.h>
void kooDu(int u,int a)
{
int addition;
addition=u+a;
printf("\n sum of the given numbers=%d as printed in called function",addition);
}
void main()
{
int p,q;
printf("\n enter 2 integers: ");
scanf("%d%d",&p,&q);
kooDu(p,q);//call by value
}
ఔట్పుట్ తెరమీద
enter 2 integers: 2 5
sum of the given numbers=7 as printed in called function
void kooDu(int u,int a)
{
int addition;
addition=u+a;
printf("\n sum of the given numbers=%d as printed in called function",addition);
}
void main()
{
int p,q;
printf("\n enter 2 integers: ");
scanf("%d%d",&p,&q);
kooDu(p,q);//call by value
}
ఔట్పుట్ తెరమీద
enter 2 integers: 2 5
sum of the given numbers=7 as printed in called function
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.