answersLogoWhite

0


Best Answer

// this v'll work to obtain sum of 1st and last number of any number

#include

int main()

{

int num,sum=0,i,fd,ld;

printf("enter the number);

scanf("%d",&num);

ld=n%10; //will get the last digit

while(num!=0)

{

fd=n;

n/10; //to get the 1st digit

}

sum=fd+ld; //add 1st n last digit

printf("\n sum of 1st n last digit is %d",sum)

}

User Avatar

Wiki User

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

Wiki User

14y ago

write a program to find the sum of squares up to 50

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write programme for sum of number given?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a pseudo code to find the sum of digits of a given number reducing them to a single digit?

5


What is it called when you write a number as a sum?

sum= answer of an addition question.. so the number of the sum is the answer.


Given 3 consecutive integers with a sum of four times the second number write an algebraic equation?

i dont now


Programme to write positive numbers until the user enters no and then sum the numbers divisible by 4 that lie between the range of 10 and 50 and finally display the count and the average value?

ALGORITHM SAMPLE i = 0 REPEAT OUTPUT ("Enter a number: ") INPUT (number[i]) i ++ UNTIL (number[i] 0) THEN counter++ sum = sum + number[i] END IF END FOR DISPLAY (counter) DISPLAY (sum / counter) END SAMPLE


How to Write a programme to print the sum of their digits using while loops?

Assuming that you mean in a series of different integers variables. (java) public static void main(String[] args) { int count = (number of vaiables); int i=0; int sum = 0; while ( i<=count) { //this is hard to write without specific variables so treat it pusedo code sum = (sum + vari); System.out.println (sum); } }


How do you write the sum of a number a and21?

a+21


Write the following in mathematical expression the sum of a number and ten?

Write the following as an algebraic expression using x as the variable: The sum of a number and -8


Write the number whose factors sum to 12?

The number is 6.


How to quantify the sum of two numbers?

Quantifying the sum of two numbers is usually simple to do. You take the given sum of the two numbers and subtract it with one given unsummed number. This will give you the other number.


How do you you write the sum of a number and 3 in algedra in expression?

n+3 the sum of a number and three means a number plus three.


How do you write the sum of a number and 1?

n + 1


How do you write the sum of a number and 15?

N + 15