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

How do you convert strings to numbers in C?

705


What is use of integral promotions in c?

660


What is a macro, and explain how do you use it?

621


What is the benefit of using an enum rather than a #define constant?

652


What do you mean by c what are the main characteristics of c language?

564






What does dm mean sexually?

806


What is main () in c language?

590


what is the difference between 123 and 0123 in c?

715


What is clrscr ()?

633


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

5191


Differentiate Source Codes from Object Codes

812


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3687


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

2677


What are the two forms of #include directive?

640


What is the explanation for the dangling pointer in c?

669