If a four digit number is through the keyboard, write a program to obtain the sum of the first and the last digit of this number.
byHarshvardhan Tandon•
0
#include<stdio.h> void main() { int num,fd,sum,ld; //programwithharsh// printf("Enter a four digit number="); scanf("%d",&num); ld=num%10; fd=num/1000; sum=ld+fd; printf("Sum of first and last digit=%d",sum); }