Showing posts with label Steps Execution. Show all posts
Showing posts with label Steps Execution. Show all posts

Sunday, June 19, 2022

 Steps Execution

Problem Statement
Take 4 digit number input from the user, add 8 to it and then divide it by 3(Only take integer part) Now, the modulus of that number is taken with 5 and then multiply the resultant value by 5. Display the final result.



import java.io.*; // for handling input/output

import java.util.*; // contains Collections framework
needed
class Main {
    public static void main (String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
 int i = (((n + 8)/3)%5)*5
 System.out.println(i);         
    }
}

ads vert

Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody

  Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody < table >      < thead >    ...