Computer Science, asked by rawatharshit9099, 7 months ago

Write a code to display the series from 1 till the number entered by the user using while loop​

Answers

Answered by shubhambhosale123
2

Answer:

Code in C language

#include <stdio.h>

int main()

{

   int number,count = 1;  

   printf("Enter a positive number\n");  

   scanf("%d", &number);  

   printf("Numbers from %d to %d:\n",count,number);  

   while(count <= number)  

   {  

       printf("%d  ",count);  

       count++;  

   }  

   printf("\n");  

   return 0;  

}

Similar questions