关于c是否其他 [英] about c regarding if else

查看:120
本文介绍了关于c是否其他的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果执行了一部分并且执行了另外一部分,那么如果阻塞这样的话,我应该写些什么.
if(?)
轰炸
其他
加尔各答
我想将孟买加尔各答都作为输出

解决方案

这是一个愚蠢的技巧问题. Google [ ^ ]以获得答案


也许您应该购买一本基本的C书(到底为什么要学习C?甚至不学习C ++或C#?),然后逐步学习? /blockquote>

您不知道. else子句的要点是,仅当if子句未执行时才执行.

但是,您是否考虑过仅在if后面加上顺序代码?

if ( ... )
{
   sometimes_do_this();
}
always_do_this();


what should i write in if block such tha if part is executed and also else part is executed.
if(?)
bombay
else
calcutta
i want bombay calcutta both as output

解决方案

This is a stupid trick question. Google[^] for answers


Perhaps you should buy a basic C book ( why on earth are you learning C ? Not even C++, or C# ? ), and work through it ?


You don''t. The point of the else clause is that it is only executed when the if clause is not.

However, have you considered just following an if with sequential code?

if ( ... )
{
   sometimes_do_this();
}
always_do_this();


这篇关于关于c是否其他的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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