if a five-digit number is input through the keyboard, draw a flowchart to print code a as 1st three digits and code b as last two digits. example: input: 12345 code a: 123 code b:45
#include <stdio.h>
int main()
{
int n, a, b;
printf("Input: ");
scanf("%d", &n);
b = n % 100;
a = n / 100;
printf("Code A: %d", a);
printf("Code B: %d", b);
return 0;
}
Comments
Leave a comment