I have started to program in C, just recently. Do any of you guys know how to add colors to the lines. I would like to do this to make my code look more than just black and white.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
system("cls");
int A, B, C, D, E;
A = 1;
B = 2;
C = 3;
D = 4;
E = 5;
printf("\n\n\t The value of (AA+BB)/(CC+DD) = %10d", ((A*A + B*B)/(C*C + D*D)), "\n" );
printf("\n\n\t The value of (AA + BB - CC)/(2AB) = %10d", (A*A + B*B - C*C)/(2*A*B), "\n" );
printf("\n\n\t The value of (A(B-C)(C-D)(D-E))/(A+B+C+D+E) = %10d", (A*(B-C)*(C-D)*(D-E))/(A+B+C+D+E), "\n" );
printf("\n\n\t The value of (A^3 - B^3)/(C^3 + D^3) = %10d", (A*A*A - B*B*B)/(C*C*C + D*D*D), "\n" );
printf("\n\n\n\n\n\n\n");
}
The reason why ((A*A + B*B)/(C*C + D*D)) doesn't work is because it evaluates to 5 / 25. Since they are integers the division equals to 0 with a remainder of 25.
In this case the "\n" is likely to just be ignored by printf. Some implementations may warn that the number of arguments don't match the number of specifiers in the format string.