100% c function to add 2 numbers
// Online C compiler to run C program online
#include <stdio.h>
int kooDu(int,int);//function prototyping
void main()
{
int p,q,mottam;
printf("\n enter two integers:");
scanf("%d%d",&p,&q);
mottam=kooDu(p,q);
printf("\n sum of given numbers %d & %d =%d as printed in main()",p,q,mottam);
}
int kooDu(int a,int b) //function definition
{
int z;
z=a+b;
printf("\n sum of given numbers %d & %d =%d as printed in the called function",a,b,z);
return(z);
}
#include <stdio.h>
int kooDu(int,int);//function prototyping
void main()
{
int p,q,mottam;
printf("\n enter two integers:");
scanf("%d%d",&p,&q);
mottam=kooDu(p,q);
printf("\n sum of given numbers %d & %d =%d as printed in main()",p,q,mottam);
}
int kooDu(int a,int b) //function definition
{
int z;
z=a+b;
printf("\n sum of given numbers %d & %d =%d as printed in the called function",a,b,z);
return(z);
}
ఔట్పుట్ తెరమీద
enter two integers:1
3
sum of given numbers 1 & 3 =4 as printed in the called function
sum of given numbers 1 & 3 =4 as printed in main()
3
sum of given numbers 1 & 3 =4 as printed in the called function
sum of given numbers 1 & 3 =4 as printed in main()
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.