Q.no program to print the last digit of the number in c-programing?
#inlcude<stdio.h>
#inlcude<conio.h>
void main()
#inlcude<conio.h>
void main()
{
int a,b;
printf("entre a number");
scanf("%d",&a);
b=a%10;
printf("last digit is %d",b);
getch();
}
output:- a=45678 last digit is b=8
No comments:
Post a Comment