Project C
Project C
Project C
KUNNAMKULAM
KIZHOOR (PO), THRISSUR (DT),
KERALA PIN:680503
KIZHOOR(PO), THRISSUR(DT),
KERALA PIN : 680509
CERTIFICATE
That is to certify that the report of group project titled programming using C ‘ was presented by
______________ Reg no:______________ partial fulfilment of the requirement for the award of diploma
in computer engineering under the technical education department during the academic year 2022 at
Government Polytechnic College, Kunnamkulam.
DATE :
EXTERNAL EXAMINER:
INTERNAL EXAMINER: HEAD OF THE SECTION
ACKNOWLEDGEMENT
At first, I like to express my indebtedness to the Almighty God who showered His abundant grace on me take
this project a success. I wish to my sincere thanks to seena I T our principal and Seena IT head of the
department of computer engineering for their valuable guidance and also thanks to provide as all necessary
facilities. I would like to extend my gratitude to main instructor of the IT lab, sabu kurian for providing and
leading to the necessary information to do the project. I am extremely thankful to our respected lecturers
for their keen interest and valuable suggestions in this project in addition I would like to all staff members
of computer department and all my friends of CT S3 for their suggestion and constructive critics.
ABSTRACT
In the last few years, the C programming language has become one of the most widely used
languages for applications and systems software on microcomputer systems. This paper describes
the C language and its history.
C is a procedural Programming language with a static system that has the functionality of
structured programming, recursion, and lexical variable scoping. C was created with constructs that
transfer well to common hardware instructions. It has a long history of use in programs that were
previously written in assembly language.
C programming language is a machine-independent programming language that is mainly used to
create many types of applications and operating systems such as Windows, and other complicated
programs such as the Oracle database, Git, Python interpreter, and games and is considered a
programming foundation in the process of learning any other programming language.
TABLE OF CONTENT
1. Introduction
2. What is C programming
3. Uses of C programming
4. Advantages and disadvantage
5. C keywords
6. C operators
7. Array
8. Recursive function
9. Program report
10. Conclusion
11. Reference
INTRODUCTION
C is a procedural programming language. It was initially developed by Dennis Ritchie in the year 1972. It was
mainly developed as a system programming language to write an operating system. The main features of
the C language include low-level memory access, a simple set of keywords, and a clean style, these features
make C language suitable for system programming like an operating system or compiler development.
Many later languages have borrowed syntax/features directly or indirectly from the C language. Like syntax
of Java, PHP, JavaScript, and many other languages are mainly based on the C language. C++ is nearly a
superset of C language (Few programs may compile in C, but not in C++).
WHAT IS C PROGRAMMING
Example:
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}
DISADVANTAGES
• Lack of object orientation
• Inefficient memory management
• No garbage collection
• Concept of namespace is not presented in c
• Absence of exception handling
C OPERATORS
ARRAY
An array in C is a collection of items stored at contiguous memory locations and elements can be accessed
randomly using indices of an array. They are used to store similar type of elements as in the data type must
be the same for all elements. They can be used to store collection of primitive data types such as int, float,
double, char, etc of any particular type.
Different ways of declaring an Array
Disadvantages of an Array:
It allows us to enter only fixed number of elements into it. We cannot alter the size of
the array once array is declared. Hence if we need to insert more number of records than
declared then it is not possible. We should know array size at the compile time itself
TWO DIAMENSIONAL ARRAY
An array of arrays is known as 2D array. The two dimensional (2D) array is also known as matrix. A matrix
can be represented as a table of rows and columns. The syntax to declare the 2D array is given below.
data_type array_name[rows][columns];
Initialization of Two Dimensional Array
There are two ways to initialize a two Dimensional arrays during declaration.
1. int A[2][3] = { {10, 11, 12},{14, 15, 16}};
int A[][3] = { {10, 11, 12},{14, 15, 16}};
RECURSIVE FUNCTION
A function that calls itself is known as a recursive function. And, this technique is known as recursion. While
using recursion, programmers need to be careful to define an exit condition from the function, otherwise it
will go into an infinite loop. Recursion makes program elegant. However, if performance is vital, use loops
instead as recursion is usually much slower.
PROGRAM REPORT
#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;
{
int daycode;
int d1, d2, d3;
D1 = (year – 1.)/ 4.0;
D2 = (year – 1.)/ 100.;
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” );
for ( day = 1; day <= 1 + daycode * 5; day++ )
{
printf(“ “);
}
printf(“%2d”, day );
if ( ( day + daycode ) % 7 > 0 )
printf(“ “ );
else
printf(“\n “ );
}
int main(void)
{
printf(“\n”);
}
OUTPUT:
CONCLUSION:
Mini project “Calendar Application” is also a simple project built in C. It displays a nicely formatted
calendar of every month.
REFERENCE:
• www.cprogaming
• www.programiz.com
• www.tutorialspoint.com
• www.Youtube.com