CARVIEW |
Select Language
HTTP/2 200
content-type: text/html; charset=utf-8
date: Sun, 12 Oct 2025 03:43:39 GMT
permissions-policy: interest-cohort=()
strict-transport-security: max-age=31536000; includeSubDomains
server: nginx
cache-control: s-maxage=45540, max-age=0
x-powered-by: Next.js
etag: "me7ld52kwc74lw"
content-encoding: gzip
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-eval' 'unsafe-inline'; frame-ancestors 'self';
vary: Accept-Encoding
x-cache: Miss from cloudfront
via: 1.1 3aaaff332058d4d14de10d30ca08781e.cloudfront.net (CloudFront)
x-amz-cf-pop: BOM78-P9
x-amz-cf-id: D_pkgaa22oV3nhEJRx7apbjnMJEaaW9RQzDU1Yrez7T5LCAnX7rKuA==
How many times will the following loop execute?
Java
Interview Preparation
- Interview Preparation For Software Developers
- Must Coding Questions - Company-wise
- Must Do Coding Questions - Topic-wise
- Company-wise Practice Problems
- Company Preparation
- Competitive Programming
- Software Design-Patterns
- Company-wise Interview Experience
- Experienced - Interview Experiences
- Internship - Interview Experiences
How many times will the following loop execute?
Last Updated :
Discuss
Comments
How many times will the following loop execute?
int i = 1;
while (i <= 5) {
System.out.println("Hello");
}
5 times
6 times
Infinite times
Compilation Error
This question is part of this quiz :
Java Control Statements and LoopsTags:
Share your thoughts in the comments

GeeksforGeeks