Answer to Question #244594 in C for Prashant Thakur

Question #244594
Q2. If a five-digit number is input through the keyboard, Draw a flowchart to print code A as I three digits and code B as last two digits.

Example: Input: 12345

Code A: 123

Code B:45
1
Expert's answer
2021-09-29T18:43:52-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS