Answer to Question #245687 in C for Hemant

Question #245687

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


1
Expert's answer
2021-10-02T10:55:57-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