Computer Science, asked by iuyyye, 5 months ago

execute a programme to print a series of number from 1 to 100 using for loop .​

Answers

Answered by Anonymous
1

Answer:

Using loop  

#include <stdio.h>

void main(void)

{int count;

for(count = 1; count <= 100; count++)

printf("%d ", count);

printf("\n");

}

If you want to print without loop then two types

Using goto statement:

#include <stdio.h>  

int main()  

{  

int i = 0;  

begin:   i = i + 1;  

printf("%d ", i);  

  if (i < 100)  

goto begin;    

return 0;  

}  

Output:1 2 3 4 . . . 97 98 99 100

Using recursive main function:

#include <stdio.h>  

int main()  

{  

static int i = 1;    

if (i <= 100)  

{  

printf("%d ", i++);    

main();  

}  

return 0;  

}

Output:1 2 3 4 . . . 97 98 99 100

PLZ MARK AS BRIANLIEST,FOLLOW ME AND THX FOR THE SUPERB QUESTION

Answered by kellyquinn13
0
int i;
for (int i=1 ; i<=100 ; i++)
System.out.println(i)
By this you can get your desired output
Mark me as brainlest

You check it out in bluej or eclipse
Similar questions