c
Imports
#include <stdio.h>
Constants
#define NUMERIC_CONSTANT 123
Main
void main() {
system("pause");
}
Declarations
// unsigned, sizeof()
char c = '1';
short s = 2;
int i = 4;
long l = 8;
float f = (float)4;
double d = (double)8;
long double ld = (long double)16;
Output
printf("int: %d\n", entry1);
printf("float: %.2f\n", f);
Input
scanf("%d%s%d", &entry1, &operator, &entry2);
Conditions
if (condition) {
expression1;
} else {
expression2;
}
switch (operator) {
case '+':
expression1;
break;
default:
printf("Nope!\n");
}
Loops
for (declarations;conditions;increments) {
expression1;
}
while (condition) {
expression1;
}
do {
expression1;
} while (condition);
Comments