
输入N,它等于要打印的系列的最大数
Input : N=5 Output : 0 ¼ ½ ¾ 1
算法
START Step 1 -> declare start variables as int num , den, i, n Step 2 -> input number in n Step 3 -> Loop For from i to 0 and i<n and i if inner num="i/4" den="0" end outer else set print step> End For Loop STOP</n>
示例
#include <stdio.h>
int main(int argc, char const *argv[]) {
int num, den;
int i, n;
printf("Enter series limit<p>");
scanf("%d", &n); //Till where the series will be starting from zero
for (i = 0; i </p>
<p>",num, den);
}
else //else print in a normal number form
printf("%d</p>
<p>", num);
}
return 0;
}</p></stdio.h>
输出
如果我们运行上述程序,它将生成以下输出
Enter series limit 5 0 1/4 1/2 3/4 1











