程序的输出是什么? [英] What is the output of program?

查看:129
本文介绍了程序的输出是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将数字写入n(输入)的代码,但由于if语句在程序中有变化。

程序的输出是什么以及为什么?



我的尝试:



code to write numbers till n(input) but due to if statement there are changes in program.
What would be the output of the program and why?

What I have tried:

#include<stdio.h>
int main()
{
int i=1,n;
printf("enter value of n");
scanf("%d",&n);
for(i=1;i<=n;)
{
    printf("%d",i);
    if(i=0)
    break;
    i++;
}
}

推荐答案

引用:

该程序的输出是什么以及为什么?

What would be the output of the program and why?



运行程序,你就会知道答案。

为什么因为你写这个程序的方式。

建议:学习C来理解你的程序。


Run the program and you will know the answer.
"Why" because of the way you writen the program.
Advice: Learn C to understand your programs.


你是我们在业内所称的帮助吸血鬼。你只是希望其他人为你努力学习。
You are, what we call in the industry, a Help Vampire. You just want other people to do the hard work of learning for you.


这篇关于程序的输出是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆