package com.dibyendu; import java.util.Scanner; public class assign11 { public static void main(String[] args) { // n = 1 // 3n + 2 = 5 Not a multiple of 4 // n = 2 // 3n + 2 = 8 is a multiple of 4 ... stop Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println("Enter a number"); int sum; for (; sum % 4 != 0; n++) sum = 3 * n + 2; System.out.println(sum); } }
n
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)