Can someone help me out its a homework. I wrote the program just stuck.


1)Write a program that will ask the user to enter a number. Then createa loop of your choice that will multiply the number by itself thenumber of times equal to the number itself. Like the power functionin math x raised to the y power. Do this with a loop, not the mathpower function.


my program

Code:

Code:
#include <stdio.h>


int main()


{
int a; 
int x;


printf("Enter a Number\n");
fflush(stdin);
scanf("%d", & a);


for (int i=0; i<=x; i++)
    a= a*a;
  {
      printf("The result is %d \n",a);
  }  
  
}
which ever number i pick the program its suppose to multiply it that many times so if i pick 3 its gonna do 3x3x3

my program i wrote whats to multiply any number i put in to the 4th power. can someone help me out and guide me the right way please and thank you.