/*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();
}
#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();
}
sum = x ^ y;
carry = x & y;
while(carry!=0)
{
x = sum;
y = carry <<1;
sum = x ^y;
carry = x &y;
}
printf("sum = %d",sum);
#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;
}
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
This is not a question so you do not need to use a question mark at the end of your sentence.
public static final int getSum(final int n) { int sum = 0; for(int i = 1; i <= n; ++i) { sum += i; } return sum; }
you can use the condition statement like for(i=0:i<=10;i++)
$vi sum.sh echo "enter the 1st no." read num1 echo "enter the 2nd no." read num2 sum= 'expr $num1 + $num2' echo "sum of the numbers is $sum"
#include #include #include void main(){char a;int firstInt, secondInt, sum;cout > firstInt >> secondInt;sum = firstInt + secondInt;cout
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
the sum of two consecutive integers is -241, what is the larger integer?
SUM = 0: FOR N = 1 to 100: SUM = SUM + N: Next N: PRINT CHR$(11); "Sum ="; SUM: END
public class sum { public static void main(String args[]){ int sum=0; for(int i=1;i<=10;i++){ sum=sum+i; } System.out.println(sum); } }
This is not a question so you do not need to use a question mark at the end of your sentence.
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
#include <stdio.h> int main(){ int a,b scanf("%d",&a); scanf("%d",&b); a=a+b; printf("%d",a); return 0; } Hope this can help you ☺
A program that calculate the sum of two numbers. #include <stdio.h> int main() { int num1; int num2; int sum; printf("Please enter first integer:\n"); scanf("%d", &num1); printf("Please enter second integer:\n"); scanf("%d", &num2); sum = num1 + num2; printf("The sum of the two integers are %d\n", sum); return 0; } Written by simply. Hope this helps!
Yes, please do.
If you write down all of the integers between the two numbers, your sum is equivalent to 5,659.
public static final int getSum(final int n) { int sum = 0; for(int i = 1; i <= n; ++i) { sum += i; } return sum; }