My issue
printf(“%d”,3 + 4);
printf(“%d”,2 + 1); how it prints 73 . it should print
7
3
My code
printf("%d",3 + 4);
printf("%d",2 + 1);
Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone
printf(“%d”,3 + 4);
printf(“%d”,2 + 1); how it prints 73 . it should print
7
3
printf("%d",3 + 4);
printf("%d",2 + 1);
Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone
The program doesn’t know whether to print in next line or in the same line
to print in next line there is a command that is to be used “\n”
use that with “%d” like “%d\n” and it will get you the answer
include <stdio.h>
int main(void) {
printf(“%d\n”,3+4);
printf(“%d”,2+1);
return 0;
}
it will print
7
3
in separate line.
You just forgot to “\n”.