// Mar0308.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "time.h" int _tmain(int argc, _TCHAR* argv[]) { // Display the values of all 256 ascii strings: int i; char key; printf("Dec. hex HEX Octal Character\n"); for (i = 96; i< 127; i++) { printf("%3d %2x %2X %O %c\n", i, i, i, i, i, i); if ( (i+1) % 16 == 0) { printf("\n\n\n ...Press the key to continue..."); key = getchar(); if (i != 255) printf("Dec. hex HEX Octal Character\n"); } } printf(" ...Press the key to continue..."); key = getchar(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\nNew Program Segment...\n\n\n"); printf("Here's where we figure out which day today is...!\n\n\n"); //struct dosdate_t date_today; //getdate(&date_today); //printf("Today's Month, Day, Year are: %d %d %d\n", date_today.tm_mday, date_today.tm_mon, date_today.tm_year); time_t t; t = time(NULL); printf("Today's date and time: %s\n", ctime(&t)); struct tm *tblock; tblock = localtime(&t); printf("Today's date (Mon, Day, Year) is: %d %d %d\n\n\n",tblock->tm_mon, tblock->tm_mday, tblock->tm_year); printf("Today is the %3d-th day of the year\n\n", tblock->tm_yday); printf(" ...Press the key to continue..."); key = getchar(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\nNew Program Segment...\n\n\n"); printf("Here's where we switch the Caps/Lower case of all the letters in a word...\n\n\n\n\n\n\n\n"); int x1, x2; printf("Enter a word and I'll reverse the \n"); printf(" Cap / Lowercase status of each letter! \n"); printf("OR, just press the key to stop! \n"); while( (x1 = getchar()) != 10) { if (x1 < 95) x2 = x1 + 32; else x2 = x1 - 32; printf("%c", x2); } printf("\n"); return 0; }