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

What is file in c language?

782


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1629


How do you define structure?

798


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1061


Explain the term printf() and scanf() used in c language?

830


Is javascript based on c?

801


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2288


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

1818


Write a program to find the biggest number of three numbers in c?

824


How can you return multiple values from a function?

845


What is a constant?

820


What’s the special use of UNIONS?

880


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

886


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2003


Explain what are multibyte characters?

876