C语言求2的n次幂.

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 15:14:39
C语言求2的n次幂.C语言求2的n次幂.C语言求2的n次幂.#includeintmain(){intm=0;longintresult=0;printf("enterm:");scanf("%d",

C语言求2的n次幂.
C语言求2的n次幂.

C语言求2的n次幂.
#include
int main()
{
int m = 0;
long int result = 0;
printf("enter m:");
scanf("%d",&m);
if(0 == m)
{
printf("2^0 = 0\n");
return 0;
}
result = 2