/* * programming_operators_operands.c * * Created on: Sep 27, 2023 * Author: johnsontimoj */ //////////////////////////////////// // // Program to show operands and operators // // inputs: user // outputs: prints // ////////////////////////////////// #include int main(void){ setbuf(stdout, NULL); // splash printf("----------------------------\n"); printf(" practice with operators and operands\n"); printf("----------------------------\n\n"); // declare some variables int a; int b; int c; float d; float e; float f; char g; char h; char i; // start an infinite loop (on faith for now) while(1){ // get some values printf("Please enter 2 ints, 2 floats, and 2 chars: "); scanf("%i %i %f %f %c %c", &a, &b, &d, &e, &g, &h); // try some expressions c = a / b; f = d / e; i = g / h; printf("%i\t%f\t%c\n", c, f, i); c = a % b; // f = d % e; i = g % h; printf("%i\t%f\t%c\n", c, f, i); c = a++ + b--; printf("%i\t%i\t%i\n", a, b, c); f += d - e; printf("%f\t%f\t%f\n", d, e, f); printf("\n\n"); }// end while return 0; }// end main