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

Write a C Program to display the following menu: Menu 1. Display 2. Copy 3. Append 4. Exit Accept the choice (1-4) from the user, and perform the following tasks: Choice 1: Accept a file name from the user and display the file on screen Choice 2: Accept two file names, and copy first file to the second Choice 3: Accept two file names, and append second file to the first file Choice 4: Terminate the program

1 Answers   Accenture, Concor, DMU, Satyam, Syntel, Tora,


How can you read a directory in a C program?

0 Answers  


what will be the output of" printf("%d%d",scanf("%d% d",&a&b));"

4 Answers  


Define Spanning-Tree Protocol (STP)

0 Answers  


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

0 Answers  






What is hashing in c?

0 Answers  


What is the difference between char a[] = "string"; and char *p = "string"; ?

14 Answers   Adobe, Honeywell, TCS,


What is struct node in c?

0 Answers  


What is the size of structure in c?

0 Answers  


Compare and contrast compilers from interpreters.

0 Answers  


Tell me with an example the self-referential structure?

0 Answers  


could u able to tell about suresoft technical session

1 Answers  


Categories