write a program to read a four digit integer and print the s
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/06/05 02:26:36
write a program to read a four digit integer and print the sum of its digits.
Hint :Use / and % operators.
Hint :Use / and % operators.
/>#include<stdio.h>
int main()
{
\x05int a,b,c,d,num;
\x05printf("please input a num between 1000~9999!\n");
\x05scanf("%d",&num);
\x05a=num/1000;
\x05b=num/100%10;
\x05c=num/10%10;
\x05d=num%10;
\x05printf("%d\n",a+b+c+d);
}
accept please!thanks
int main()
{
\x05int a,b,c,d,num;
\x05printf("please input a num between 1000~9999!\n");
\x05scanf("%d",&num);
\x05a=num/1000;
\x05b=num/100%10;
\x05c=num/10%10;
\x05d=num%10;
\x05printf("%d\n",a+b+c+d);
}
accept please!thanks
write a program to read a four digit integer and print the s
Java write a program to read an integer,n,from the keyboard
Write a program to print the first 10 Fibonacci numbers.Each
Write a program which asks the user for four numbers and the
A:Read and write.
关于java编程问题Write an algorithm and a program to settle the fol
Write a program which asks the user for four numbers(Python)
Read the following letter and write a reply to help the trou
To view and print the agreements,click each link and print a
T is the ten digits of a two-digit positive integer
when shuold a child start learing to read and write
read the e-mail from Fran and write a reply