Problem Description
Ram was a popular maths teacher, he gave a 4 digit number to his students as a assignment .He has to identify ones portion of given number. Please help his students to identify and display the output:
Input and Output Format:
Input can be an integer
Explanation :
Let us say ram given number is 1234 and his student need to identify ones portion is 4
CODING
ARENA::
#include
<stdio.h>
int
main()
{
int a,b;
scanf("%d",&a);
b=a%10;
printf("The Digit at ones place of %d
is=%d",a,b);
return 0;
}
Test Case 1
Input (stdin)
72
Expected Output
The Digit at ones place of 72 is=2
Test Case 2
Input (stdin)
456
Expected
Output
The Digit at ones place of 456 is=6
FOR ANY QUERIES PLEASE COMMENT.
ReplyDelete