运行结果:
C语言代码:
/* c how to program 习题3.37 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 number
int number = 0;
//当number为1-100时执行循环
...
运行结果:
C语言代码:
/* c how to program 习题3.36 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 number
long int number = 0;
//当number为1-1000000000时执 ...
运行结果:
C语言代码:
/* c how to program 习题3.35 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 二进制数值binary 临时数值temp 每位的数值bit 基数factor 十进制数值 ...
运行结果:
C语言代码:
/* c how to program 习题3.34 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量
int number;
printf("请输入一个5位的整数:");
...
运行结果:
C语言代码:
/* c how to program 习题3.33 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量
int side, x, y;
//获取边长
printf("请输入正方形的边长1-20 ...
运行结果:
C语言代码:
/* c how to program 习题3.32 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量
int side, x, y;
//获取边长
printf("请输入正方形的边长 ...
运行结果:
C语言代码:
/* c how to program 习题3.30 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
int x, y;
printf("请输入x的值:");
scanf("%d", &x);
printf(" ...
(a)运行结果:
(a) C语言代码:
/* c how to program 习题3.30 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
int x, y;
int z = 1;
while( z ){
printf("请输入x的值 ...
运行结果:
C语言代码:
/* c how to program 习题3.29 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义并初始化变量count为0
unsigned int count = 10;
//定义变量row
...
运行结果:
C语言代码:
/* c how to program 习题3.28 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//初始化变量count为0
int count = 0;
//当count少于10执行循环
whil ...