Question: Programming chatlenge description: Given positive integers A,B, and N, write a program that prints integers from 1 to N. But for integers that are multiples

Programming chatlenge description: Given positive integers A,B, and N, write a program that prints integers from 1 to N. But for integers that are multiples of A, print ' F ', and for multiples of B, print 'B'. For integers which are multiples of both A and B, print 'FB'. Input: Your program should read tines of text from standard input. Each tine will contain A, B, and N as spacedelimited positive integers. Outiputs For each line of input, print to standard output a Une of space-delimited integers 1 through N, replacing integers as described above. Test 1 Test Tnput 0 Expected Output B Test 2 Test Input Q Expected Output b 1F3=5FBF9=11F13 FB 15 Here are given code you need to accomplish: process.stdin.resume(); process.stdin.setEncoding ('utf8'); var stdin =; process.stdin.on ('data', function (chunk) \{ stdin += chunk; \}).on ('end', function() \{ var lines = stdin.trim().split('In'); for (var i=0; ii++ ) \{ process.stdout.write (write(lines[i]); \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
