CSN101 Project Report Sample
CSN101 Project Report Sample
CSN101 Project Report Sample
Submitted to
Faculty Name
Assistant Professor
Submitted by:
Name- Divya Pal
Roll no-230102552
SAP ID- 1000020372
Section-C(P1)
SCHOOL OF COMPUTING
DIT UNIVERSITY, DEHRADUN
(State Private University through State Legislature Act No. 10 of 2013 of Uttarakhand and approved by UGC)
I hereby certify that the work, which is being presented in the Report, entitled “PRINTING
CALENDER”, in partial fulfilment of the requirement as part of the course Programming for
Problem Solving of the Degree of Bachelor of Computer Science and Engineering and
submitted to the DIT University is an authentic record of my work carried out during the
period 22/11/2023 to 27/11/2023 under the guidance of Faculty name.
Date:
Signature of the Candidate
Cover Page 01
Candidate’s Declaration 02
Table of Contents 03
Introduction 04
Project Description 05
Purpose
Problem Statement
System Requirements
Functions used
Source Code
Output
Result Analysis
Conclusion 16
Bibliography 17
Problem statement:
Given a year, the program should:
1. Determine the number of days in each month, including adjustments for leap years.
2. Calculate the starting day of the week for each month.
3. Format the calendar output with proper alignment and spacing.
System Requirements:
The code should adhere to the following system requirements:
• Programming Language: C
• Development Environment: Any compatible C compiler and editor
• Input: The year for which the calendar should be printed
• Output: A formatted calendar for the specified year
This function takes an integer representing the year as input and returns an integer indicating
whether the year is a leap year. A leap year is a year that has 29 days in the month of February.
The project includes functions to input the year, determine the day code, check for leap years,
and print the calendar for each month. The code is well-structured and utilizes arrays and nested
loops efficiently. Here's a breakdown of the code:
Calculates the day code for the given year using determinedaycode()
Calculates the day code for the given year using Zeller's congruence
Checks if the given year is a leap year using the Gregorian calendar rules
Determines the starting spaces using the day code and prints them
Overall, the code effectively fulfills the task of printing a calendar for any given year,
demonstrating a clear understanding of the Gregorian calendar and programming concepts.
#include<stdio.h>
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()
{
int year;
year = inputyear();
daycode = determinedaycode(year);
determineleapyear(year);
calendar(year, daycode); printf("\
n");
}
/*******************************************************************
END OF CODE
********************************************************************/
This project effectively achieves the task of printing calendars for various years entered by the
user, demonstrating a well-structured implementation of programming concepts and a clear
understanding of the Gregorian calendar. The code provides a solid foundation for further
enhancements and could serve as a useful tool for visualizing and understanding the structure of
the calendar.
Bibliography
Name:- Divya Pal SAP ID:- 1000020372 Branch:- CSE
REFERENCE:-
1. Google
2. Wikipedia
3. Let Us C by “Yashavant Kanetkar”
4. www.indiabix.com