answersLogoWhite

0

// 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

13y ago

What else can I help you with?

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 twice the sum of a number and 600?

To write twice the sum of a number and 600, you first express the number as a variable, such as ( x ). The sum of the number and 600 can be written as ( x + 600 ). Therefore, twice this sum is represented as ( 2(x + 600) ).


What is the result when you add 2 to a given number?

The result of adding 2 to a given number is the sum of the given number and 2.


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

a+21


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 15?

N + 15