menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Rewrite the following program segment using a while loop instead of a for loop. for(i=0;i<100;i++){ if (i%2===0){ print (i) } }
asked
Apr 14, 2022
190k
views
0
votes
Rewrite the following program segment using a while loop instead of a for loop.
for(i=0;i<100;i++){
if (i%2===0){
print (i)
}
}
Computers and Technology
college
NonDucor
asked
by
NonDucor
8.4k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
2
votes
Answer:
while i=0 or i<100:
if (i%2==0):
print(i)
Lord Windy
answered
Apr 19, 2022
by
Lord Windy
8.8k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Aug 2, 2022
66.8k
views
Convert the given for loop to while loop and find the output of the program assuming the value entered for num is 15. num = int (input ("Enter a value")) sum =0 count=0 for i in range (1, num): if i%2
Niyamat Ullah
asked
Aug 2, 2022
by
Niyamat Ullah
8.3k
points
Computers and Technology
high-school
1
answer
4
votes
66.8k
views
asked
Dec 12, 2024
12.4k
views
Which line(s) of code have a runtime or compile error: package cop3337.exam3; public class COP3337Exam3 public static void main(String[] args) int[] numbers = new int[10]; try try 2 3 for(int i=0; i< 10; i++) numbers [i] = 18 *i; 13 14 if(i%2== 1) throw new Exception("P1"); 15 16 17 if(i%2==0) throw new ArrayIndexOutOfBoundsException("P2"); 18 19 20 //end for catch(ArithmeticException e) System.out.print(e.getMessage() + " L1"); catch(ArrayIndexOutOfBoundsException e) System.out.print(e.getMessage()+" L2 "); catch(Exception e) System.out.println(e.getMessage()+" L3 "); finally throws new Exception("L4"); catch(Exception e) 33 34 35 System.out.println(e.getMessage()+" L5"); 36 37 System.out.print("\\"); //end main 38 39 //end class 12, 32 15 No error in code: 29
Nataliia
asked
Dec 12, 2024
by
Nataliia
7.8k
points
Computers and Technology
high-school
1
answer
5
votes
12.4k
views
asked
Jan 17, 2024
111k
views
What will be the output of the following code snippet? word = "Python Programming" n=len(word) word1=word.upper() word2=word.lower() converted_word="" for i in range (n): if i%2==0: converted_word+=word2[i]
Piotr Leniartek
asked
Jan 17, 2024
by
Piotr Leniartek
8.1k
points
Computers and Technology
high-school
2
answers
2
votes
111k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org