Add to Favorites    Make Home Page 14856 Online  
 Language Categories  
 Our Services  

Home » C Home » Beginners / Lab Assignments Home » Date Detection

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Date Detection
Author L.Rajmohan
Author Email raj_lmr [at] yahoo.co.in
Description This exactly displays the day when you give the date, month, and year.
Category C » Beginners / Lab Assignments
Hits 364581
Code Select and Copy the Code
Code : #include<stdio.h> #include<conio.h> #include<dos.h> void main() { int a[14][12]={{1,4,4,7,2,5,7,3,6,1,4,6},{2,5,5,1,3,6,1,4,7,2,5,7},{3,6,6,2,4, 7,2,5,1,3,6,1},{4,7,7,3,5,1,3,6,2,4,7,2},{5,1,1,4,6,2,4,7,3,5,1,3},{6,2,2, 5,7,3,5,1,4,6,2,4},{7,3,3,6,1,4,6,2,5,7,3,5},{1,4,5,1,3,6,1,4,7,2,5,7},{2, 5,6,2,4,7,2,5,1,3,6,1},{3,6,7,3,5,1,3,6,2,4,7,2},{4,7,1,4,6,2,4,7,3,5,1,3} ,{5,1,2,5,7,3,5,1,4,6,2,4},{6,2,3,6,1,4,6,2,5,7,3,5},{7,3,4,7,2,5,7,3,6,1, 4,6}}; int A,y,m,d; clrscr(); textcolor(RED); textbackground(GREEN); gotoxy(20,21); cprintf(" ???????????????????????????????????????");/*The are ascii characters*/ gotoxy(20,22); cprintf(" ?"); textcolor(BLUE+BLINK); gotoxy(30,23); cprintf("MY FIRST C PROGRAM"); textcolor(RED); gotoxy(58,23); cprintf("?"); textcolor(RED); gotoxy(20,23); cprintf(" ???????????????????????????????????????"); delay(3000); clrscr(); textcolor(RED); gotoxy(23,21); cprintf(" ????????????????????????????"); gotoxy(23,22); cprintf(" ?"); textcolor(9+BLINK); gotoxy(30,23); cprintf("BY L.RAJMOHAN"); textcolor(RED); gotoxy(50,23); cprintf("?"); textcolor(RED); gotoxy(23,23); cprintf(" ????????????????????????????"); delay(2000); clrscr(); textcolor(RED); gotoxy(23,21); cprintf(" ????????????????????????????"); gotoxy(23,22); cprintf(" ?"); textcolor(BLUE+BLINK); gotoxy(30,23); cprintf("DATE DETECTION"); textcolor(RED); gotoxy(50,23); cprintf("?"); textcolor(RED); gotoxy(23,23); cprintf(" ????????????????????????????"); delay(2000); clrscr(); cprintf(" Enter the year: "); scanf("%d",&y); if(y==1753 || y==1759 || y==1770 || y==1781 || y==1787 || y==1798 || y==1810 || y==1821 || y==1827 || y==1838 || y==1849 || y==1855 || y==1866 || y==1877 || y==1883 || y==1894 || y==1900 || y==1906 || y==1917 || y==1923 || y==1934 || y==1945 || y==1951 || y==1962 || y==1973 || y==1979 || y==1990 || y==2001 || y==2007 || y==2018 || y==2029) A=1; if(y==1754 || y==1765 || y==1771 || y==1782 || y==1793 || y==1799 || y==1805 || y==1811 || y==1822 || y==1833 || y==1839 || y==1850 || y==1861 || y==1867 || y==1878 || y==1889 || y==1895 || y==1901 || y==1907 || y==1918 || y==1929 || y==1935 || y==1946 || y==1957 || y==1963 || y==1974 || y==1985 || y==1991 || y==2002 || y==2013 || y==2019 || y==2030) A=2; if(y==1755 || y==1766 || y==1777 || y==1783 || y==1794 || y==1800 || y==1806 || y==1817 || y==1823 || y==1834 || y==1845 || y==1851 || y==1862 || y==1873 || y==1879 || y==1890 || y==1902 || y==1913 || y==1919 || y==1930 || y==1941 || y==1947 || y==1958 || y==1969 || y==1975 || y==1986 || y==1997 || y==2003 || y==2014 || y==2025) A=3; if(y==1761 || y==1767 || y==1778 || y==1789 || y==1795 || y==1801 || y==1807 || y==1818 || y==1829 || y==1835 || y==1846 || y==1857 || y==1863 || y==1874 || y==1885 || y==1891 || y==1903 || y==1914 || y==1925 || y==1931 || y==1942 || y==1953 || y==1959 || y==1970 || y==1981 || y==1987 || y==1998 || y==2009 || y==2015 || y==2026) A=4; if(y==1762 || y==1773 || y==1779 || y==1790 || y==1802 || y==1813 || y==1819 || y==1830 || y==1841 || y==1847 || y==1858 || y==1869 || y==1875 || y==1886 || y==1897 || y==1909 || y==1915 || y==1926 || y==1937 || y==1943 || y==1954 || y==1965 || y==1971 || y==1982 || y==1993 || y==1999 || y==2010 || y==2021 || y==2027) A=5; if(y==1757 || y==1763 || y==1774 || y==1785 || y==1791 || y==1803 || y==1814 || y==1825 || y==1831 || y==1842 || y==1853 || y==1859 || y==1870 || y==1881 || y==1887 || y==1898 || y==1910 || y==1921 || y==1927 || y==1938 || y==1949 || y==1955 || y==1966 || y==1977 || y==1983 || y==1994 || y==2005 || y==2011 || y==2022) A=6; if(y==1758 || y==1769 || y==1775 || y==1786 || y==1797 || y==1809 || y==1815 || y==1826 || y==1837 || y==1843 || y==1854 || y==1865 || y==1871 || y==1882 || y==1893 || y==1899 || y==1905 || y==1911 || y==1922 || y==1933 || y==1939 || y==1950 || y==1961 || y==1967 || y==1978 || y==1989 || y==1995 || y==2006 || y==2017 || y==2023) A=7; if(y==1776 || y==1816 || y==1872 || y==1940 || y==1968 || y==1996 || y==2024) A=8; if(y==1760 || y==1788 || y==1828 || y==1856 || y==1884 || y==1924 || y==1952 || y==1980 || y==2008) A=9; if(y==1772 || y==1812 || y==1840 || y==1868 || y==1896 || y==1908 || y==1936 || y==1964 || y==1992 || y==2020) A=10; if(y==1756 || y==1784 || y==1824 || y==1852 || y==1880 || y==1920 || y==1948 || y==1976 || y==2004) A=11; if(y==1768 || y==1796 || y==1808 || y==1836 || y==1864 || y==1892 || y==1904 || y==1932 || y==1960 || y==1988 || y==2016) A=12; if(y==1780 || y==1820 || y==1848 || y==1876 || y==1916 || y==1944 || y==1972 || y==2000 || y==2028) A=13; if(y==1764 || y==1792 || y==1804 || y==1832 || y==1844 || y==1860 || y==1888 || y==1912 || y==1928 || y==1956 || y==1984 || y==2012) A=14; cprintf(" Enter the month: "); scanf("%d",&m); cprintf(" Enter the date: "); scanf("%d",&d); clrscr(); cprintf(" The date is %d:%d:%d",d,m,y); textcolor(BLUE+BLINK); gotoxy(1,5); switch(a[A-1][m-1]) { case 1: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is MONDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is TUESDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is WEDNESDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is THURSDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is FRIDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is SATURDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is SUNDAY."); break; case 2: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is TUESDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is WEDNESDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is THURSDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is FRIDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is SATURDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is SUNDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is MONDAY."); break; case 3: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is WEDNESDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is THURSDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is FRIDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is SATURDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is SUNDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is MONDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is TUESDAY."); break; case 4: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is THURSDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is FRIDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is SATURDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is SUNDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is MONDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is TUESDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is WEDNESDAY."); break; case 5: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is FRIDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is SATURDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is SUNDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is MONDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is TUESDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is WEDNESDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is THURSDAY."); break; case 6: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is SATURDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is SUNDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is MONDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is TUESDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is WEDNESDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is THURSDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is FRIDAY."); break; case 7: if(d==1 || d==8 || d==15 || d==22 || d==29) cprintf(" The day is SUNDAY."); if(d==2 || d==9 || d==16 || d==23 || d==30) cprintf(" The day is MONDAY."); if(d==3 || d==10 || d==17 || d==24 || d==31) cprintf(" The day is TUESDAY."); if(d==4 || d==11 || d==18 || d==25) cprintf(" The day is WEDNESDAY."); if(d==5 || d==12 || d==19 || d==26) cprintf(" The day is THURSDAY."); if(d==6 || d==13 || d==20 || d==27) cprintf(" The day is FRIDAY."); if(d==7 || d==14 || d==21 || d==28) cprintf(" The day is SATURDAY."); break; } getch(); }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi դ ? ??
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=912


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review