How to Write a C Program to find result where value and power are user given in C Programming Language ?
Solution:
- #include <stdio.h>
- #include <conio.h>
- void main()
- {
- int a,p,n,r;
- clrscr();
- printf("Enter Number: ");
- scanf("%d",&n);
- printf("\nEnter Power: ");
- scanf("%d",&p);
- for(a=p;a!=0;a--)
- {
- r=n*n;
- }
- printf("%d",r);
- getch();
- }