0% found this document useful (0 votes)
20 views

BCP Micro Project

This document describes a calendar application project created using C language. It includes the source code and explanations of how it works. The code defines arrays for months and days in each month. It also includes functions to input the year, check if it is a leap year, determine the day code and print the calendar for the given year.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

BCP Micro Project

This document describes a calendar application project created using C language. It includes the source code and explanations of how it works. The code defines arrays for months and days in each month. It also includes functions to input the year, check if it is a leap year, determine the day code and print the calendar for the given year.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

lOMoARcPSD|24213071

Bcp Micro project

Chaibasa Engineering College (Rao Bahadur Y. Mahabaleswarappa Engineering


College)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by PAWAR YOGESH SANJAY ([email protected])
lOMoARcPSD|24213071

Micro project

NAME : Calendar Application Project

PROJECT BY : SOLANKI VISHAL , PEDHE TUSHAR

SUBJECT : Basic Computer Programming

COLLEGE NAME : RC TECHNICAL INSTITUTE

BRANCH : COMPUTER ENGINEERING

DIVISION : C034

ENROLLMENT. : 226408307010
ENROLLMENT. : 226408307009

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

Department of Computer Engineering


Abstract

This paper presents a comparative Windows and

Macintosh operating system. The basic criteria for

studying them are mostly focusing on the

fundamental memory and file management,

architecture, security, versatility and other topics.

These topics are being compared in this paper. This

research study gives us an overview of the main

topics and on the various similarities and differences

in the basic use of operating systems. Every

operating system has its own set of differences in

the composition and structure of the operating

system and this study focuses on the underlying

strengths and weaknesses of each operating

system.

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

Keywords: Windows, Mac, UI, Architecture, File

Management, Security, Choice, Cost

INTRODUCTION
C is a general-purpose programming language that is
extremely popular, simple, and flexible to use. It is a
structured programming language that is machine-
independent and extensively used to write various
applications, Operating Systems like Windows, and many
other complex programs like Oracle database, Git, Python
interpreter, and more.
It is said that ‘C’ is a god’s programming language. One can
say, C is a base for the programming. If you know ‘C,’ you
can easily grasp the knowledge of the other programming
languages that uses the concept of ‘C’
It is essential to have a background in computer memory
mechanisms because it is an important aspect when dealing
with the C programming language.
The base or father of programming languages is ‘ALGOL.’ It
was first introduced in 1960. ‘ALGOL’ was used on a large
basis in European countries. ‘ALGOL’ introduced the concept
of structured programming to the developer community. In
1967, a new computer programming language was
announced called as ‘BCPL’ which stands for Basic
Combined Programming Language. BCPL was designed and
developed by Martin Richards, especially for writing system
software. This was the era of programming languages. Just
after three years, in 1970 a new programming language
called ‘B’ was introduced by Ken Thompson that contained

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

multiple features of ‘BCPL.’ This programming language was


created using UNIX operating system at AT&T and Bell
Laboratories. Both the ‘BCPL’ and ‘B’ were system
programming languages.
In 1972, a great computer scientist Dennis Ritchie created a
new programming language called ‘C’ at the Bell
Laboratories. It was created from ‘ALGOL’, ‘BCPL’ and ‘B’
programming languages. ‘C’ programming language contains
all the features of these languages and many more
additional concepts that make it unique from other
languages.
‘C’ is a powerful programming language which is strongly
associated with the UNIX operating system. Even most of
the UNIX operating system is coded in ‘C’. Initially ‘C’
programming was limited to the UNIX operating system, but
as it started spreading around the world, it became
commercial, and many compilers were released for cross-
platform systems. Today ‘C’ runs under a variety of
operating systems and hardware platforms. As it started
evolving many different versions of the language were
released. At times it became difficult for the developers to
keep up with the latest version as the systems were running
under the older versions. To assure that ‘C’ language will
remain standard, American National Standards Institute
(ANSI) defined a commercial standard for ‘C’ language in
1989. Later, it was approved by the International Standards
Organization (ISO) in 1990. ‘C’ programming language is also
called as ‘ANSI C’.

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

How C Programming Language Works?


C is a compiled language. A compiler is a special tool that
compiles the program and converts it into the object file
which is machine readable. After the compilation process,
the linker will combine different object files and creates a
single executable file to run the program. The
following diagram shows the execution of a ‘C’
program
----

Nowadays, various compilers are available online,


and you can use any of those compilers. The
functionality will never differ and most of the
compilers will provide the features required to
execute both ‘C’ and ‘C++’ programs.
Following is the list of popular compilers available
online:

 Clang compiler
 MinGW compiler (Minimalist GNU for Windows)
 Portable ‘C’ compiler

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

 Turbo C

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

Calendar Application Project Using


C Language

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

Leap Years and the Gregorian


Calendar

The Gregorian calendar is the most widely used


calendar in the world. There are leap years in the
Gregorian calendar. There are 303 regular years
and 97 leap years in a four-hundred-year span.
The majority of people believe that every fourth
year is a leap year, although this is not the case.

How can you figure out which years


are leap years?

A leap year is one in which the year is divisible


by four. It is not a leap year, however, if the
year is divisible by 100. It is, nevertheless, a
leap year if the year is also divisible by 400. As
a result, we may form the following statement:

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

Source Code for Calendar


Application Project Using C
Language

#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"

};

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

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 && year%100 != FALSE || year%400 == FALSE)

days_in_month[2] = 29;

return TRUE;

else

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

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 " );

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

// 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");

Downloaded by PAWAR YOGESH SANJAY ([email protected])


lOMoARcPSD|24213071

Output

Thank you

Downloaded by PAWAR YOGESH SANJAY ([email protected])

You might also like