Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

1. [2] Write a program that asks the user for a positive integer, then outputs all the numbersfrom 1 to that number. 2. [2] Write a program that asks the user for a number and prints out that many...

1 answer below »
1. [2] Write a program that asks the user for a positive integer, then outputs all the numbersfrom 1 to that number.
2. [2] Write a program that asks the user for a number and prints out that many stars ona line. Continue asking the user for new numbers until they decide not to.
3. [3] Write a program that asks the user for a number, and then outputs all the factors ofthe number.
4. [3] Write a program that asks the user for a number, and then outputs a pyramid of ‘*’ whose largest layer is the entered number.
5. [2] Write a program that asks the user for a number, then outputs an offset pyramid ofstars with that many layers.
PLEASE VIEW THE DOCUMENT ATTACHED. PLEASE COMPLETE THESE QUESTIONS USING WHILE LOOPS AND AS BASIC JAVASCRIPT AS POSSIBLE. YOUARE NOT ALLOWED TO USE PROMPT BOXES FOR INPUTS. ALL INPUT MUST BE DONE ON THE PAGE ITSELF(IN AN HTML INPUT).
Answered 353 days After Apr 29, 2021

Solution

Shobhit answered on Apr 18 2022
99 Votes
Write a program that asks the user for a positive integer, then outputs all the numbers from 1 to that numbe
ANSWER 1:
#include
int main()
{
int n;
printf("Enter a positive number:");
scanf("%d",&n);
int i=1;
while(i<=n)
{
printf("%d\n",i);
++i;
}
}
Write a program that asks the user for a number and prints out that many stars on a line. Continue asking the user for new numbers until they decide not to.
ANSWER 2:
#include
int loop(int n)
{
int i=1;
while(i<=n)
{
printf("*");
++i;
}
printf("\n");
}
int main()
{
int n;...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here