以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。include <stdio.h>main(){ int n, s;printf("Enter a number:"); scanf("%d",&n);printf("Output: ");do{ s=n%10; printf("%d",s); [ ]; }while (n!=0);printf("\n');}

题目

以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。

include <stdio.h>

main()

{ int n, s;

printf("Enter a number:"); scanf("%d",&n);

printf("Output: ");

do

{ s=n%10; printf("%d",s); [ ]; }

while (n!=0);

printf("\n');

}


相似考题
更多“以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。include <stdio.h> ”相关问题
  • 第1题:

    将输入的字符串按逆序输出,例如输入abcd,则按dcba顺序输出出来,请完善程序。 #include <stdio.h> #include <string.h> int main() { char *str, s[20]; int n; str=s; scanf("%s",str); n=strlen(str); while(--n>=0) { str=&s[ ________ ]; printf("%c",*str); } return 0; }


    不唯一;

  • 第2题:

    下列程序的功能是输入一个正整数,判断是否是素数,若为素数输出1,否则输出0,请为程序填空。 #include "stdio.h" void main() { int i,x,y=1; scanf("%d",&x); for (i=2;i<=x/2;i++) if () { y=0;break;} printf("%dn",y); }


    'D:\\a1.dat'For Random Put #10ik Seek #105 根据分析可知,本题打开的文件可以先写后读,既可以读又可以写,同时又发现文件读写使用Get#和Put#语句,因此,应该用随机方式打开文件,故[13]处应填“'D:\\a1.dat'ForRandom”。通过一个For循环输入10个数,并把它们写到文件中去,因此[14]处应填“Put#10,i,r”。为读出第5个整数,必须首先把记录指针移到第5条记录处,可使用Seek#语句,故[15]处应填“Seek#10,5”。

  • 第3题:

    【填空题】以下程序段功能是输入一个小写字母,将字母循环移动5个位置后输出。例如:'a'变为'f','w'变为'b',将程序补充完整。 #include <stdio.h> int main() { char c; c=getchar(); if(c>='a'&&______) c=c+5; else _________ putchar(c); return 0; }


    在当前目录下生成子目录:/xxx/yyy

  • 第4题:

    将输入的字符串按逆序输出,例如输入abcd,则按dcba顺序输出出来,请完善程序。 #include <stdio.h> #include <string.h> int main() { char *str, s[20]; int n; str=s; scanf("%s",str); n=strlen(str); while(--n>=0) { str=&s[____]; printf("%c",*str); } return 0; }


    不唯一;

  • 第5题:

    程序每次读入一个正3位数,然后输出按位逆序的数字。 输入格式:每个测试是一个3位的正整数。 输出格式:输出按位逆序的数。 输入样例:123 输出样例:321


    #include void main(){ charline[100]; while(cin.getline(line, 100)) cout}