/*我观察到的是:
如果我给"abcd",那么输出是:"abc""d""dude"
等等*/
#include<stdio.h>
main()
{
char a[5]="help",b[3],c[10]="dude";
scanf("%s",b);
printf("\t%s",b);
printf("\t%s",a);
printf("\t%s",c);
}
/* what i dont get is :
Here iam gaving a string to b(array), why, if the string has more than the
required no. of charecters, its printing those charecters in other arrays
(though i had not assiged scanf to other arrays )?
Run Code Online (Sandbox Code Playgroud)我知道执行后的printf返回一些非零值{编辑:返回否.charecters}现在在这个例子中我使用了多个printf和现在.
/* As far as i was cocerned Precedence of && is more than ||,
*and these logical operators check from left to right
*So compiler should come to hello and print "hello" then "nice to see you" then "hie"
*as all are true it should print "hola"
*but i wonder, why here the output is only "hie" and "hola"?
*/
#include<stdio.h>
main()
{
if(printf("hie")|| printf("hello")&& printf("nice to see you"))
printf("\thola\n");
}
Run Code Online (Sandbox Code Playgroud)