How to add two numbers with using function?

Answers were Sorted based on User's Feedback



How to add two numbers with using function? ..

Answer / 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

How to add two numbers with using function? ..

Answer / vinay kumar

suppose x=5 and y=10,Then
while(y!=0)
{
x++;
y--;
}
printf("the sum value is:%d
",x);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

When should the volatile modifier be used?

0 Answers  


What is c programing language?

0 Answers  


what is dangling pointer?

1 Answers   LG Soft,


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

0 Answers   IBM,


What is the difference between %d and %*d in C

3 Answers  


What is the use of pointers in C?

0 Answers   Impetus, Motorola, Tavant Technologies, Virtusa,


What are the uses of a pointer?

0 Answers  


program in c to print 1 to 100 without using loop

9 Answers   Wipro,


Write a program on swapping (100, 50)

0 Answers   BPL,


What is C++

4 Answers  


In a byte, what is the maximum decimal number that you can accommodate?

0 Answers  


how to write palindrome program?

3 Answers  


Categories