Answer Posted / balaji
/*this program is used to add two numbers using functions */
#include<stdio.h>
#include<conio.h>
void add(int,int);
void main()
{
int x,y;
printf("enter the two digits/numbers which you want to add");
scanf("%d%d",&x,&y);
add(x,y);
getch();
}
void add(int a,int b)
{
int c;
c=a+b;
printf("the sum of %d and %d is %d",a,b,c);
}
| Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
What is scope rule of function in c?
How do I create a directory? How do I remove a directory (and its contents)?
What is c basic?
What are keywords in c with examples?
Is c is a high level language?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What are shell structures used for?
Suggesting that there can be 62 seconds in a minute?
Explain indirection?
What is an arrays?
what are # pragma staments?
If you know then define #pragma?
What are the uses of a pointer?
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
What are the advantages of c preprocessor?