Open EEE2017Assignments opened 4 years ago
I didn't check the code but %Xd is right justified if X is positive. And left justified if X is negative.
If the printed number is wider than X then it doesn't matter whether X is positive/negative, It'll be left justified.
https://www.dummies.com/programming/c/how-to-format-with-printf-in-c-programming/
The ppt might have some problems.
Then I'm gonna write the codes same with the ppt's codes.
Thank you, TA.
In slide 42, the numbers in output are right justified, but the code was printf("%4d", y); So I think it is left justified. My output and slide's output is little bit different. Just write same with slide or change it %4d to %-4d?
Thank you.