0% found this document useful (0 votes)
6 views1 page

Worksheet 1 Loops

This document contains instructions for a worksheet exercise involving loops in Java. The document provides 6 questions asking about definite and indefinite loops, counter variables, do-while loop syntax, analyzing loop execution counts and output, and writing programs to display squares and a mathematical series.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Worksheet 1 Loops

This document contains instructions for a worksheet exercise involving loops in Java. The document provides 6 questions asking about definite and indefinite loops, counter variables, do-while loop syntax, analyzing loop execution counts and output, and writing programs to display squares and a mathematical series.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

WORSHEET-1

Note: The answers to this worksheet and further on worksheets to be written in a new
book of 200 Pages long size. Write Question + Answer
I. Do as directed:-
(1) Differentiate between Definite loop and indefinite loop.
(2) What do you mean by counter variable? Give an example.
(3) Write syntax for do while loop.
(4) Analyze how many the following loops gets executed and write the output:-
(a) int x=100;
while
(x>=10)
{
System.out.println (x);
x = x – 20;
}
(b) char
ch='a'; do
{
System.out.println (ch);
if(ch%4==0)
break;
ch++;
}while (ch<='z');
(5) Write a Java Program to display all the squares from 1 to 25
(6) Write a Java Program to display the series 0, 3, 8, 15, 24,............upto 15 terms.

You might also like