Sunday, October 25, 2009

7.PRGRM TO OBTAIN THE SUM OF FIRST AND LAST DIGIT OF A 5 DIGIT NO.

//WAP TO OBTAIN THE SUM OF FIRST AND LAST DIGIT OF A 5 DIGIT NO.
#include
#include

void main()
{
int a,d;
clrscr();
printf("Enter the Five Digit No.=");
scanf("%d",&a);
d=a/10000+a%10;
printf("\n\n\nThe Sum Of First and Last Digit=%d",d);
getch();
}
/******OUTPUT******
Enter the Five Digit No.=12345



The Sum Of First and Last Digit=6
*/

No comments:

Post a Comment

Programming the Whole World!