google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to print numbers in ascending order - 2nd puc computer science

Write a program to print numbers in ascending order

Write a program to print numbers in ascending order

#include<stdio.h>

#include<conio.h>

void main()

{

int n,i=1;

clrscr();

printf("Enter the number: ");

scanf("%d",&n);

while(i<=n)

{

printf("%d,",i);

i++;

}

printf("\b.");

getch();

}

Output:

Enter the number: 10

1,2,3,4,5,6,7,8,9,10.   

Write a program to print numbers in ascending order Write a program to print numbers in ascending order Reviewed by Vision Academy on December 08, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.