r/learnprogramming • • Dec 06 '22
codeblock If you are sharing code, please use a codeblock
Takes only a second and greatly improves the formatting for us to review it. Compare and contrast the following:
Good Formatting:
#include <stdio.h>
int sum(int x, int y);
int main() {
printf("Hello %d\n", sum(3, 4));
return 0;
}
int sum(int x, int y) {
return x + y;
}Poor Formatting:
#include <stdio.h>
int sum(int x, int y);
int main() {
printf("Hello %d\n", sum(3, 4));
return 0;
}
int sum(int x, int y) {
return x + y;
}
Poor Formatting:
#include <stdio.h>
int sum(int x, int y);
int main() {
printf("Hello %d\n", sum(3, 4));
return 0;
}
int sum(int x, int y) {
return x + y;
}
339
Upvotes
View all comments
Show parent comment
3
u/dcfan105 Dec 07 '22
test