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

Is it valid to address one element beyond the end of an array?

0 Answers  


Difference between data structure and data base.

7 Answers   CTS, Value Labs, Zoho,


Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.

1 Answers  


My teacher ask to make a program that can: Insert record in front Insert record at the end Insert in between Search node record Delete record in front Delete record at the end Delete record in between Using Data structure Linked List type. But I'm really confused about the codes and I can't go through. Please help Thanks in advance. Also here is my unfinished code if someone can make changes it will be more good.

1 Answers  


What are the benefits of organizational structure?

0 Answers  






Who invented b language?

0 Answers  


WHOT IS CHAR?

4 Answers   TCS,


What is the explanation for cyclic nature of data types in c?

0 Answers  


program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5

8 Answers   Infosys,


write a c prog for removing duplicate character from an array and sorting remaining elements using a single array

1 Answers  


What are the two types of functions in c?

0 Answers  


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

0 Answers  


Categories