C Program to find result where value and power are user given

How to Write a C Program to find result where value and power are user given in C Programming Language ?


Solution:

  1. #include <stdio.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5.  int a,p,n,r;
  6.  clrscr();
  7.  printf("Enter Number: ");
  8.  scanf("%d",&n);
  9.  printf("\nEnter Power: ");
  10.  scanf("%d",&p);
  11.  for(a=p;a!=0;a--)
  12.  {
  13.   r=n*n;
  14.  }
  15.  printf("%d",r);
  16.  getch();
  17. }


Learn More :