projects
- intro (due 20140124)
- "Hello, World!" (due 20140131)
- data types (due 20140207)
- Squares (due 20140214)
- Day of Week (due 20140221)
- Nikhilam (due 20140228)
- Multiply by 11 (due 20140307)
- Vertically and Crosswise (due 20140321)
projects
#include <stdio.h> #include <stdlib.h> int main() { int a, *b; short int c; char d; float e; b = (int *) malloc (sizeof(int) * 1); fprintf(stdout, "Enter an integer: "); fscanf(stdin, "%u", &a); fprintf(stdout, "Enter another integer: "); fscanf(stdin, "%u", b); // why don't we need & in this case? fprintf(stdout, "Enter a short int: "); fscanf(stdin, "%hu", &c); fprintf(stdout, "Enter a char: "); fscanf(stdin, "%c", &d); fprintf(stdout, "Enter a float value: "); fscanf(stdin, "%f", &e); fprintf("Your ints are: %u and %u\n", a, *b); fprintf("Your short int is: %hu\n", c); fprintf("Your char is: '%c'\n", d); fprintf("Your float (trimmed at 2 decimal places) is: %.2f\n", e); return(0); }