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)

}

Study guides

☆☆

Q: Write program for sum of first and last digit of a number?

Write your answer...

Submit

Still have questions?

Related questions

8 : the units digit is the first digit to the left of the decimal point if you had to write one in.

next number to this series is 554325. its look like this 15--add 1 to first digit and we get 2 and repeat two times and leave other digit.225 225-- its first digit is 2 and add 1 to it get 3 and write two time and write remaining digit as 3325. 3325-- its first digit is 3 and add 1 to it get 4 and write two time and write remaining digit as 44325. 44325-- its first digit is 4 and add 1 to it get 3 and write two time and write remaining digit as 554325.

This first digit is the first number. In this case the first digit is the number 2.

#include<stdio.h> #include<conio.h> void main(void) { int num, a, b, sum; printf(""Please enter a four digit number: ""); scanf("%d", &num); a=num/1000; // retrives the first digit(left most digit) b=num%10; //retrieves the fourth digit(right most digit) sum=a+b; printf("The sum of first and last digit is %d", sum); }

A leading digit is the digit/number at the beggining of a decimal number or regular number and is the first number to the left.

0 is the ten's digit of the first odd number.

The first two-digit prime number is 11.

first you look at the first number tell what that number is then you just find the first digit.

first triple digit pentagonal pyramidal number is 126

The first 'three digit' Prime Number is 101.

208

It does not have to be. 864/2 = 432. The first digit of the quotient is not in the tens place.

People also asked