Here is another C program for displaying an empty diamond. This is another C program code for displaying a triangle. The user will input the base for the diamond (or triangle). The maximum input for this program is 40 although can easily be changed when implemented. #include #include int base, row, column, temp; main() { // Input Area – do-while is used to validate such that only inputs from 0 to 40 are accepted do { system(“cls”); printf(“Enter base : [...]
The following format specifiers can be used when programming in C. %d (or %i) int %c char %f float %lf double %s string %x hexadecimal By specifying an integer between the % and the format specifier, the number of spaces displayed can be controlled easily. %9d will display 9 spaces before a character is displayed %09 will display 9 zeros (0) before a character is displayed %-9d a negative sign will left align the result %-09d a zero(0) format will [...]






