Write a program PyramidUp.c that reads an integer from the user and outputs the
ID: 3669371 • Letter: W
Question
Write a program PyramidUp.c that reads an integer from the user and outputs the following pattern where the number of stars at the bottom is equal to the number read. Write a program PyramidDown.c that reads an integer from the user and outputs the following pattern alternating stars and equal signs where the number of stars at the top is equal to the number read Write a program CubicRoot.c that reads four decimals from the user: a, b, c, d and tries to find if the equation ax^3 + bx^2 + cx + d = 0 has any squareroots in the range -100..100. Your program should try decimals in the given range in small steps (eg. 0.01) and evaluate the equation at every step. If the equation evaluates to 0, the program should output the corresponding value of x. Compile all programs and produce and executable with the same name as the program.Explanation / Answer
/*c program for PyramidUp*/
#include<stdio.h>
#include<conio.h>
int main()
{
int num=6,r,c,sp;
for(r=1; num>=r; r++)
{
for(sp=num-r; sp>=1; sp--)
printf(" ");
for(c=r; c>=1; c--)
printf("*");
for(c=r; c>1; c--)
printf("*");
printf(" ");
}
getch();
return 0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.