How to add two numbers with using function?

Answer Posted / geetha

#include<stdio.h>
#include<conio.h>
int add(int,int);
main()
{
int a,b,c;
printf("enter a,b values");
scanf("%d%d",&a,&b);
c=add(a,b);
printf("%d",c);
}
int add(int x,int y)
{
return(x+y);
}

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are local variables initialized to zero by default in c?

779


What is the use of a ‘’ character?

827


What do you mean by command line argument?

862


Simplify the program segment if X = B then C ← true else C ← false

2819


p*=(++q)++*--p when p=q=1 while(q<=6)

1514


How can I determine whether a machines byte order is big-endian or little-endian?

853


Explain what math functions are available for integers? For floating point?

870


What is the difference between fread and fwrite function?

871


How can I write functions that take a variable number of arguments?

871


What is formal argument?

898


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

2091


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

887


What is sizeof int in c?

848


show how link list can be used to repersent the following polynomial i) 5x+2

1921


What is the purpose of the statement: strcat (S2, S1)?

875