Feed Headline Animator

If a four digit number is input through the keyboard. Write a program to obtain the sum of the first and last digit of this number.

main( )
{
int n,sum ,fd,ld;
Printf(“/n Enter the four digit number”);
Scanf(“%d”,&N);
Id=n%10;
Fd=n/1000;
Printf(“/n First digit is%d and last digit is “,fd,id);
Sum=fd+id;
Printf(“/n Sum of first and last digit =%d”,sum);
}

Posted by: Wasim Javed

2 comments: