0

hi guys got a question here how can you display output 1 to 35 in a variable declared with the value of 1 (a=1; with the condition of 1>100 ??? in a for loop structure

sorry if i dont make sense guys..

im kinda new to this thing

4
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by Anuradha Mandal
0

are you trying to display 1 to 53 numbers on screen as an output of your program?please explain a little bit more..

0

i need to display 1 to 35 numbers as an output...with the condition of 1 to 100

sorry if i dont make sense again

0

you can use one more variable "counter" in for loop in which you can set the condition till 35 so that if that variable goes to increase from 35 than the condition goes to false any numbers from 1 to 35 will be printed

0

oh,i kinda get what you were saying, but can you give an actual example??
if its ok with you

0

ya you can try for this-
int count=1
for(int i=1;i<100;i++)
{
if (count<35)
{
SOP(count);
count++;
}
exit;
}
i hope it helps you..

0

ok tnx again :)...im going to try it :)

i hope it works

hehe...

-1

IF YOU WANT TO PRINT ! TO 35. tHEN THE PROGRAM WILL BE

for(i=0;i<=35;i++)
cout<<i;

Your question is not clear to me.
Please submit what you have tried.

0

cout<<i is c++ not Java

if you need to have the conditions of 1 - 100

for (int i = 1; i <= 100; i++){ // loops from 1 - 100
  if (i <=35){ // checks if it is between 1 and 35
    System.out.println (i); // prints out the number
  }
}

Edited by sirlink99: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.