Write C++ program to print all natural numbers in reverse order using DO WHILE LOOP.
Write C++ program to print sum of digits enter by user using WHILE LOOP.
Plzz solve both questions very urgent
No google answers pls
Answers
Answered by
0
Answer:
/**
* C program to all natural numbers in reverse from n to 1 using while loop
*/
#include <stdio.h>
int main()
{
int n;
/*
* Input a number from user
*/
printf("Enter value of n: ");
scanf("%d", &n);
while(n>=1)
{
printf("%d\n", n);
n--;
}
return 0;
}
Explanation:
Answered by
0
Answer: How to print natural numbers in reverse order in C programming. Logic to print natural numbers in reverse for a given range in C program. Logic to print natural numbers in reverse is almost similar to printing natural numbers from 1 to n. Step by step descriptive logic to print natural numbers in reverse. Input start limit from user
Explanation:
Similar questions