Functions of Header files:
- stdio.h Stands for standard I/O Header File.
- conio.h Stands for consol I/O Header File.
- .h indictes the Extension of the Header File.
- <stdio.h> Header File includes scanf() and printf() Functions.
- <conio.h> Header file includes clrscr() and getch() Functions.
Statement of C program: Enter a Number and its Exponent and Show the Result.
#include<conio.h>
void main()
{
int a,b,c,d ;
clrscr();
printf("Enter the number:\n ");
scanf("%d" ,&a);
printf(" Enter the Power of number:\n");
scanf(" %d" , c);
d=a;
for(b=2 ; b<=c ; b++)
{
a=a*d;
}
printf(" Result=%d" , a);
getch();
}
Output:
Enter the number:
5
Enter the Power of number:
3
Result=125
0 Response to "C Program: Enter the Number and its Power and Compute the Result"
Post a Comment