问题abt printf在Turboc上 [英] problem abt printf on Turboc

查看:50
本文介绍了问题abt printf在Turboc上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要一个关于此代码的帮助

请帮助我

以下代码我在Turboc上工作

我期待的结果与已印刷的结果不同我

表示该行与 / *这一个* /第10行我没想到第一个%ld和第二个%d

的6553,但是它以不同的方式打印我也粘贴打印结果,

它低于代码。

我完全糊涂了,因为我得到了一个答案,这取决于

编译器,但我不是满意。可以任何身体善良的人帮助

我有正确的解释


感谢和问候


/ *代码* /


1 int main(无效)

2 {

3 unsigned int un = 3000000000; / *系统具有32位int * /

4短端= 200; / *和16位短* /

5 unsigned int big = 6553;

6 long long verybig = 12345678908642;

7 clrscr( );

8 printf(un =%u而非%d \ n,un,un);

9 printf(" end =%hd和%d \ n",end,end);

10 printf(big =%ld而不是%d \ n,大,大); / *这一个* /

11 printf(" verybig =%lld而非%ld \ n",verybig,verybig);

12 getch();

13返回0;

14}

输出低于


un = 24064不是24064

结束= 200和200

big = 429463961而不是996 / *< -why它是996 whynot 6553 * /

verybig = 1942899938而不是1942899938

Hello all ,
I need a help on this code
kindly help me out
for the below code I worked on the Turboc
the result I was expecting was different from what has been printed I
have indicated the line with " /*this one*/" line no 10
I did expected some junk for the first %ld and 6553 for the second %d
,but it printed in different way I am also pasting the result printed ,
it is below the code .
I am totally confused because I got one answer that was it depends on
compiler but I am not satisfied .can any body kind hearted people help
me with proper explanation

thanks and regards

/*code */

1 int main(void)
2 {
3 unsigned int un = 3000000000; /* system with 32-bit int */
4 short end = 200; /* and 16-bit short */
5 unsigned int big = 6553;
6 long long verybig = 12345678908642;
7 clrscr();
8 printf("un = %u and not %d\n", un, un);
9 printf("end = %hd and %d\n", end, end);
10 printf("big = %ld and not %d\n", big,big); /*this one */
11 printf("verybig= %lld and not %ld\n", verybig, verybig);
12 getch();
13 return 0;
14 }
the Output is below

un = 24064 and not 24064
end = 200 and 200
big = 429463961 and not 996 /* <-why it is 996 whynot 6553*/
verybig= 1942899938 and not 1942899938

推荐答案

mu ************ @ hotmail.com 写道:


以为我会尝试融入... ;-)
mu************@hotmail.com wrote:

Thought I''d try blending in ... ;-)
大家好,
我需要一个关于此代码的帮助
请帮助我
以下代码我工作关于Turboc
我期待的结果与已印刷的结果不同我已经指出 / *这一个* /第10行我没想到第一个%ld和第二个%d / 6553有一些垃圾,但它以不同的方式打印我也粘贴打印的结果,
它在下面代码。
我完全感到困惑,因为我得到了一个答案,这取决于
编译器,但我不满意。可以任何身体善良的人帮助
我正确解释
感谢和问候

/ *代码* /

1 int main(无效)
2 {
3 unsigned int un = 30亿; / *系统具有32位int * /
4短端= 200; / *和16位短* /
5 unsigned int big = 6553;
6 long long verybig = 12345678908642;


< error message =" OT in c.l.c" cause =" Not ISO C"

redirect =" borland.public.cpp.turbocpp">

7 clrscr();


< / error>

8 printf(" un =%u and not%d \ nn",un,un);
9 printf(" end =%hd and%d\ n",end,end);
10 printf(big =%ld而非%d \ n,大,大) ; / *这一个* /
11 printf(" verybig =%lld而不是%ld \ n",verybig,verybig);
12 getch();
13返回0;
14}

输出低于

un = 24064而不是24064
end = 200和200
big = 429463961而不是996 / *< -why它是996 whynot 6553 * /
verybig = 1942899938而不是1942899938
Hello all ,
I need a help on this code
kindly help me out
for the below code I worked on the Turboc
the result I was expecting was different from what has been printed I
have indicated the line with " /*this one*/" line no 10
I did expected some junk for the first %ld and 6553 for the second %d
,but it printed in different way I am also pasting the result printed ,
it is below the code .
I am totally confused because I got one answer that was it depends on
compiler but I am not satisfied .can any body kind hearted people help
me with proper explanation

thanks and regards

/*code */

1 int main(void)
2 {
3 unsigned int un = 3000000000; /* system with 32-bit int */
4 short end = 200; /* and 16-bit short */
5 unsigned int big = 6553;
6 long long verybig = 12345678908642;
<error message="OT in c.l.c" cause="Not ISO C"
redirect="borland.public.cpp.turbocpp">
7 clrscr();
</error>
8 printf("un = %u and not %d\n", un, un);
9 printf("end = %hd and %d\n", end, end);
10 printf("big = %ld and not %d\n", big,big); /*this one */
11 printf("verybig= %lld and not %ld\n", verybig, verybig);
12 getch();
13 return 0;
14 }
the Output is below

un = 24064 and not 24064
end = 200 and 200
big = 429463961 and not 996 /* <-why it is 996 whynot 6553*/
verybig= 1942899938 and not 1942899938



我没有得到你

如果有任何错误,请注释行clrscr()和getch()

谢谢

I didnt get you
if it is any error please comment the lines "clrscr()" and "getch()"
thanks




mu ************ @ hotmail.com 写道:
我没有得到你
如果有任何错误请注释行clrscr()和getch()
I didnt get you
if it is any error please comment the lines "clrscr()" and "getch()"




请忽略Eltee。他/她/这是一个新收购的巨魔轮。


- 迈克尔

-

电子邮件:我的是一个gmx点地址。



Please ignore "Eltee". He/she/it is a newly acquired troll round here.

- Michael
--
E-Mail: Mine is a gmx dot de address.


这篇关于问题abt printf在Turboc上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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