How to add two numbers with using function?

Answer Posted / sathish kumar .k

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,i;
int sum=0;
clrscr();
printf("Enter Two Nos");
scanf("%d%d",&a,&b);
for(i=0;i<a;i++)
sum=sum+1;
for(i=0;i<b;i++)
sum=sum+1;
printf("Sum:%d",sum);
getch();
}

Is This Answer Correct ?    18 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the return type of sizeof?

579


What are the different data types in C?

716


Was 2000 a leap year?

616


What is indirection?

637


Explain how do you sort filenames in a directory?

594






What does return 1 means in c?

575


a value that does not change during program execution a) variabe b) argument c) parameter d) none

682


What is the purpose of the preprocessor directive error?

667


What is pointer to pointer in c with example?

540


What does p mean in physics?

575


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1719


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.

702


What are structures and unions? State differencves between them.

600


What is the use of the function in c?

588


If errno contains a nonzero number, is there an error?

784