answersLogoWhite

0


Best Answer

/*use "c-free" compiler*/

#include <stdio.h>

main()

{

int a,b,c;

printf("enter the value of a & b");

scanf("%d%d",&a,&b);

c=a+b;

printf("sum of the two numbers is a+b- %d",c);

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

main()

{

int a,b,c;

printf("enter the value of a and b");

scanf("%d%d", &a,&b);

c=a+b;

printf("sum of the two numbers is a-b-%d",c);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

sum = x ^ y;

carry = x & y;

while(carry!=0)

{

x = sum;

y = carry <<1;

sum = x ^y;

carry = x &y;

}

printf("sum = %d",sum);

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

#include<iostream.h>

void main()

{

int a,b,sum;

cout<<"Enter the two nubers";

cin>>a>>b;

sum=a+b;

cout<<"The sum is "<<sum;

return 0;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you Write a program in c to calculate the sum of two integers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you Write a program in c language to calculate the sum of two integers?

#include #include #include void main(){char a;int firstInt, secondInt, sum;cout > firstInt >> secondInt;sum = firstInt + secondInt;cout


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


How do you calculate integers?

the sum of two consecutive integers is -241, what is the larger integer?


Write a shell program that Adds the integers 1 to 100 and dislay a message?

SUM = 0: FOR N = 1 to 100: SUM = SUM + N: Next N: PRINT CHR$(11); "Sum ="; SUM: END


How do you write a program in java to print sum of first ten integers?

public class sum { public static void main(String args[]){ int sum=0; for(int i=1;i&lt;=10;i++){ sum=sum+i; } System.out.println(sum); } }


Write a program in pascal that declares two integers and gives there sum?

This is not a question so you do not need to use a question mark at the end of your sentence.


Write a program that calculates and prints the sum of the even integers from 2 to 30?

For N = 2 to 30 STEP 2 Sum = Sum + N Next N Print "The sum is "; Sum; ". Have a nice day. Come back and see us." END


Can you show me whole code how do you write a program in c to calculate the sum of two integers?

#include &lt;stdio.h&gt; int main(){ int a,b scanf("%d",&amp;a); scanf("%d",&amp;b); a=a+b; printf("%d",a); return 0; } Hope this can help you &#9786;


Write a program two find the sum of ywo numbers?

A program that calculate the sum of two numbers. #include &lt;stdio.h&gt; int main() { int num1; int num2; int sum; printf("Please enter first integer:\n"); scanf("%d", &amp;num1); printf("Please enter second integer:\n"); scanf("%d", &amp;num2); sum = num1 + num2; printf("The sum of the two integers are %d\n", sum); return 0; } Written by simply. Hope this helps!


Write a algorithm to find sum of n integers?

Yes, please do.


The sum of all the integers between 50 to 350 which end in 1 is?

If you write down all of the integers between the two numbers, your sum is equivalent to 5,659.


Write a program to calculate the sum of the sequence number from 1 to n loop?

public static final int getSum(final int n) { int sum = 0; for(int i = 1; i &lt;= n; ++i) { sum += i; } return sum; }