In: C Programming
19 Dec 2011Question: Write a program where it asks the user to input the amount of days in the desired month and also the starting day (1=SUN, 2=MON,3=TUES. etc).
The Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include <stdio.h> #include <stdlib.h> int main(void) { int i = 0, day_of_week = 0, number_of_days = 0; printf("Enter the number of days in the month:\n"); scanf("%d",&number_of_days); printf("Enter starting day of the week:\n 1=SUN 2=MON 3=TUE...\n"); scanf("%d",&day_of_week); for (i = 1; i < day_of_week; i++) printf(" "); for (i = 1; i <= number_of_days; i++) { printf("%2d ", i); if(day_of_week == 7) { printf("\n"); day_of_week = 0; } day_of_week++; } printf("\n"); system("pause"); return 0; } |
Output Example:
Number of Days: 29
Starting on Tuesday
In: Audio
16 Dec 2011A friend of mine gave me the Pioneer SX-316 Home Theater Receiver System a few months back. Last week, the volume knob stopped working, the volume would not go up or down and I didn’t have the remote control. This receiver is a little old but it sounds amazing.
I contacted Pioneer to purchase the remote but they charge $22, which is too high for a system this old. I decided to try with a universal remote control first and then if i had no sucess I was going to purchase the Pioneer remote control.
The other day when I booted my desktop it took a good 5-10 minutes after I put my password to actually load my desktop. My desktop PC has a Core i5 processor (quadcore) and 2 gig of rams, enough for my computer to be fast. I decided to run the Windows 7 Installation disk to see if it was my installation that needed repair but there were no errors found. I decided to take a look at the programs that I had installed in the previous days to see if that would fix my problem.