coderrohan14

LoopingQues1.java

Jun 27th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Solution {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. int n = sc.nextInt();
  7. int ans = 1;
  8. while(ans*ans<=n){
  9. ans++;
  10. }
  11. ans--;
  12. System.out.println(ans);
  13. }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment