write a program to print integer no, from 1 to n where n is the input from the user using do while loop in c language use getch

Question

write a program to print integer no, from 1 to n where n is the input from the user using do while loop in c language use getch
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

Here is a simple C program that uses a do-while loop to print integers from 1 to n, where n is input from the user. Please note that C does not have a built-in function for getch, so I will use getchar instead.

#include <stdio.h>

int main() {
    int i = 1, n;

    printf("Enter a number: ");
    Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv

This problem has been solved

Similar Questions

write a program to print integer no, from 1 to n where n is the input from the user using do while loop in c language use getch

create a C program to print Fibonacci series upto a specified number N using while loop.

Write a Python program to print the square of first 10 natural numbers, using while loop

Write a Python program using a while loop to calculate and display the factorial of a user-inputnumber. Ensure your program handles invalid inputs gracefully.

Write the program to enter integer elements from user in singly linked list. User can enter both andeven values.

1/3