Write programme for sum of number given?

1 answer

Answer

1077959

2026-04-17 12:55

+ Follow

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

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.