[Solved] Reading Characters from StdIn [closed]

Try the Scanner class. Like this: import java.util.Scanner; public class New { public static void main(String[] args) { System.out.println(“Calculator”); Scanner scanner = new Scanner(System.in); System.out.println(“Enter Parameter “); System.out.print(“a : “); float a = scanner.nextFloat(); System.out.print(“+|-|*|/: “); String op = scanner.next(); System.out.print(“b : “); float b = scanner.nextFloat(); float c = 0; switch (op) { case … Read more

[Solved] multiple line inputs in C

You can use fgets() to read the lines, and then strtok() to parse each line, this is a sample program, i’ve used the first element of the integer array as the array count, so you don’t need to store it in a separate variable, I did that because I assume you can have different length … Read more