#include<stdio.h>
#define TRUE 1
#define FALSE 0
int days_in_month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
char *months[]=
{
" ",
"\n\n\nJanuary",
"\n\n\nFebruary",
"\n\n\nMarch",
"\n\n\nApril",
"\n\n\nMay",
"\n\n\nJune",
"\n\n\nJuly",
"\n\n\nAugust",
"\n\n\nSeptember",
"\n\n\nOctober",
"\n\n\nNovember",
"\n\n\nDecember"
};
int inputyear(void)
{
int year;
printf("Please enter a year (example: 1999) : ");
scanf("%d", &year);
return year;
}
int determinedaycode(int year)
{
int daycode;
int d1, d2, d3;
d1 = (year - 1.)/ 4.0;
d2 = (year - 1.)/ 100.;
d3 = (year - 1.)/ 400.;
daycode = (year + d1 - d2 + d3) %7;
return daycode;
}
int determineleapyear(int year)
{
if(year% 4 FALSE)
{
days_in_month[2] = 29;
return TRUE;
}
else
{
days_in_month[2] = 28;
return FALSE;
}
}
void calendar(int year, int daycode)
{
int month, day;
for ( month = 1; month <= 12; month++ )
{
printf("%s", months[month]);
printf("\n\nSun Mon Tue Wed Thu Fri Sat\n" );
// Correct the position for the first date
for ( day = 1; day <= 1 + daycode * 5; day++ )
{
printf(" ");
}
// Print all the dates for one month
for ( day = 1; day <= days_in_month[month]; day++ )
{
printf("%2d", day );
// Is day before Sat? Else start next line Sun.
if ( ( day + daycode ) % 7 > 0 )
printf(" " );
else
printf("\n " );
}
// Set position for next month
daycode = ( daycode + days_in_month[month] ) % 7;
}
}
int main(void)
{
int year, daycode, leapyear;
year = inputyear();
daycode = determinedaycode(year);
determineleapyear(year);
calendar(year, daycode);
printf("\n");
}
...QBASIC program code... name$="Jack" startCharPos%=2 howManyChars%=2 PRINT MID$(name$,startCharPos%,howManyChars%) ...output... ac EXPLANATION The MID$() function allows you to select characters from out of a string. In the above case the string is,... name$="Jack" ...where... J= string position 1 a= string position 2 c= string position 3 k= string position 4 ...thus, if we select MID$(name$,2,2)... ...this code is actually saying...select from the name...the character which begins at position 2 = a/and, extract 2 characters going along from there... = ac.
remove the battery and plug the power supply You mean running on AC power without a battery?
Christmas light have always been AC.
ac
ac voltage
OK. Done that
24 Windows on an Advent Calendar
How about 24 windows on an advent calendar - or 24 wheels on an amoured car?
Are you asking what BC and AD are, they are Before Christand the Latin phrase Anno Domini meaning Year of the Lord, never heard of AC on calendars.
write a c program to circular queue
#include <stdio.h> #include<conio.h> #include<process.h> #include <string.h> #include <stdlib.h> #define pf printf void main() { int a[],b[],i,len,j; clrscr(); pf("\nenter the binary number:"); gets(a); len=strlen(a); for(i=0;i<len;i++) { if(a[i]==0a[i]==1) continue; else { pf("\nenter correctly"); exit(0); } strcpy(b,a); for(
{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.
DJ A.C. The Program Director is the author and founder of HipHopPhilosophy.com, HipHopPhilosophy.com Radio, and HipHopPhilosophy.com Radio clothing.
form_title= AC Moore form_header= Find all your crafting supplies at AC Moore. What type of project are you creating?*= _ [50] What supplies do you need?*= _ [50] Are you a part of the rewards program?*= () Yes () No
I need a step by step print out of how to recharge my 2001 Ford Escape XLT. I plan on refilling with R-134 Freon. Can you help me?
#include <stdio.h> int main() { int fact=1,num; printf("Enter number: "); scanf("%d",&num); if((num==0) (num==1)) { printf("Factorial = %d",fact); return 0; } else { while(num!=1) { fact=fact*num; num--; } printf("Factorial = %d",fact); return 0; } }
I once worked on a 318 Chrysler V-8 which ran on Natural Gas that drove an 80 ton AC compressor and cooled a print shop, Real pig...