Sie sind auf Seite 1von 19

Project Report for DOEACC

‘ O’ Level

C LANGUAGE PROJECT

Submitted by

Submiss Name – Mr Pradeep Gautum

Date – 26/07/2018 Reg - 1108764

Guide By;-

Vijay Rajput

Name and Address of the Accredited


Institute:
Chanakya –ACL(ACCR No- 01845)
1212/289A,Awad Nagar.
CHANAKYA- ACL(ACCR NO-01845)
1212/289A, Award Nagar.

To

Executive Director.
DOEACC Society
6. CGO Complex
Lodhi Road
New Delhi-110003
Sir
I am submitting my ‘ O’ Level Project for evaluation Details of my
Registration and postal address ,etc is as under .

Reg No - 1108764
Course - O, level
Name - Pradeep Gautum
Fathers Name - Mr. Rajendra Singh Gautam
Mother’s Name - Chandra Devi
Institute Name -Chanakya ACL Mainpuri
ACCR No - ACCR-01848
Address - Rajkey Awas D/39 Type Colony Civil Line
Golabazar Mainpuri
Certificate of Institute

This is to certify that this project report titled “C language Project” has
been prepared by “ Pradeep Gautam” Reg.No. 1108764 of Doeacc ‘O’
Level under my supervision and guidance. The work done by the
candidate is the outcome of extensive study on the above course.

I wish him to a bright future.

……

Vijay Rajput
CERTIFICATE OF THE INSTITUTE

This is certify that the project work named “C LanguageProjectdone at


“Chanakya-Acl, Mainpuri” by Pradeep Gautum (DOEACC Registration No:
1108764) in partial fulfillment of ‘O’ Level Examination has been found
satisfactory

This report had not been submitted for any other examination and
does not form a part of any other course undergone by the candidate.

It is further certified that he/she has appeared in all the four modules.

Date:

Signature

(By head of the institution with PROV NO. /FULL NO. )

(By head of the Organization / Division)


CERTIFICATE OF AUTHOR

Myself Pradeep Gautam is the student of DOEACC ‘O’ Level. I am pursuing


this course from “Chanakya-ACL, Awadh Nagar, Station Road Mainpuri” Pin
No: 205001 (U.P.) accredited to DOEACC SOCIETY, New Delhi. I declare that I
did not submit this project report for any award. It May only for the partial
fulfillment of DOEACC ‘O’ Level. I tired to make a good project report
according to my knowledge.

Pradeep Gautam

Reg. No. 1108764


What is C Language

C is general-purpose procedural programming language


developed by Dennis Ritchie at AT&T’s Bell laboratories in 1972.
It is a high-level programming language. However, often referred
as a middle-level programming language; since it provides rich
support to low-level programming constructs.

The development of C began, to re-implement the UNIX operating


system. It is such a powerful language that most of the popular
operating systems are completely or partially written in C. It is
mostly used for the development of Operating systems, Kernels,
Compilers, Device drivers, embedded systems, RDBMS packages
etc.

C is also called as the mother of all programming languages.


Because most of the modern computer programming languages
directly or indirectly influenced from C (such as C++, Java, C#,
PHP, Perl, and JavaScript etc.).
History of C Language

The advent of C programming begin in the late 1960s and share roots
deep in the development of UNIX operating system. UNIX is a
popular network operating system that pumps heart of the modern
internet. In late 1960s Ken Thompson and Dennis Ritchie developed,
a language called B. Earlier version of UNIX uses B programming
language. It inherits many of its features from BCPL (Basic Combined
Programming Language).
Later in the early 1970s need for a portable operating system and
programming language originated. Rather developing programs and
operating system for a particular machine. The need of a portable
operating system came in existence. This was the period when
development of C programming language started.
During 1969 to 1972, Dennis Ritchie at Bell Laboratories developed
C. In 1972, the first release of C programming got officially public. C
inherited many features from ALGOL, BCPL and B. It is such a
powerful language that UNIX operating system is almost completely
written in C.
In 1978, it gained huge popularity from the Bell laboratories to the
heart of every programmer. Brain Kernighan along with Dennis
Ritchie published the first book on C "The C Programming Language".
The book is popularly also known as "K&R C book”.
To learn C in much better way, this is a must read book on C
programming.
C Standards
The massive popularity of C programming headed development of its versions.
However, every version was similar to the original but often incompatible. To assure
the standard of C in every version, American National Standards Institute (ANSI)
initiated work on C standards.

In 1989, ANSI sets base for all implementations of C compilers and published the first
standard of C. The first C standard is popularly known as C89. The current C standard
is commonly referred as C11.
Features of C Language
C is a popular programming language among programmers. It is one of the
widely used programming language in the world.

Features of C programming language

Simple and Robust


For beginner’s C is the easiest language to learn. Its simplicity lies in the
lesser number of programming constructs that can power up any complex
system. However, some concepts of C programming can become nightmare
for beginners. C supports a rich set of built-in library functions and a
variety of operators.

Portability
C is a machine independent language. C programs can run on a range of
machines that has a C compiler. Today almost every machine has a
minimum C compiler installed on it. Hence, when you write programs in C
you should not worry, whether your program will run on a particular
machine or not. However, C does not supports platform independency as
Java.
Modularity
C programs are modular in nature. We can divide C programs to several modules that
will combine in a single module to build the final program.

Extensibility
C language provides a rich set of built-in library function. We can also build
our own library functions and can use them in future. Because of
modularization of programs, you can extend your C programs anytime.

Speed
The compilation and execution of C programs are faster than modern
programming languages.

Wide acceptability
C programming is widely known among programmers around the world.
Because of its vast popularity, it is suitable for most of the system projects.
Why should I learn C programming?
Whether you are beginning your programming life or you have learnt
programming. Learning C has its own importance, below are the few
advantages of C, over other programming languages.

 C is a simple language, compared any other modern programming


languages. It contains a lesser number of programming constructs that
makes it easy to learn. However, some concepts of C programming can be a
nightmare for beginners.
 Learning C will make you understand how a computer program functions
internally.
 Despite being a high-level programming language its ability to provide rich
support for low-level programming separates it from modern programming
languages.
 The Backbone of Operating system development is C. Most of the popular
OS either fully or partially written in C.
 C is the main programming language used in Apple iOS apps and OS
development as Objective C. Objective C is the Object Oriented version of C
programming.
 C language is widely used for the development of Compilers, Assemblers,
Language Interpreters, Device drivers, Databases, Embedded systems,
Server, Game frameworks etc.
 Most of the modern programming languages either directly or indirectly
inherited from C. Therefore, C will definitely help to learn C inherited
languages.
Some Example of C Language

/* C program to find perimeter of rectangle


*/

#include <stdio.h>

int main()
{
float length, width, perimeter;

/*
* Input length and width of rectangle from user
*/
printf("Enter length of the rectangle: ");
scanf("%f", &length);
printf("Enter width of the rectangle: ");
scanf("%f", &width);

/* Calculate perimeter of rectangle */


perimeter = 2 * (length + width);

/* Print perimeter of rectangle */


printf("Perimeter of rectangle = %f units ", perimeter);

return 0;
}

Output

Enter length of the rectangle: 5


Enter width of the rectangle: 10
Perimeter of rectangle = 30.000000
/*
C program to find maximum between three numbers using nested if
*/

#include <stdio.h>

int main()
{
int num1, num2, num3, max;

/* Input three numbers from user */


printf("Enter three numbers: ");
scanf("%d%d%d", &num1, &num2, &num3);

if(num1 > num2)


{
if(num1 > num3)
{
/* If num1 > num2 and num1 > num3 */
max = num1;
}
else
{
/* If num1 > num2 but num1 > num3 is not true */
max = num3;
}
}
else
{
if(num2 > num3)
{
/* If num1 is not > num2 and num2 > num3 */
max = num2;
}
else
{
/* If num1 is not > num2 and num2 > num3 */
max = num3;
}
}

/* Print maximum value */


printf("Maximum among all three numbers = %d", max);

return 0;
}

Output

Enter three numbers: 10


50
120
Maximum among all three numbers = 120
/**
* C program to print multiplication table of a number
*/

#include <stdio.h>

int main()
{
int i, num;

/* Input a number to print table */


printf("Enter number to print table: ");
scanf("%d", &num);

for(i=1; i<=10; i++)


{
printf("%d * %d = %d\n", num, i, (num*i));
}

return 0;
}

Input

Input num: 5

Output

5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
/*
C program to print right triangle star pattern series
*/

#include <stdio.h>

int main()
{
int i, j, n;

/* Input number of rows from user */


printf("Enter value of n: ");
scanf("%d", &n);

for(i=1; i<=n; i++)


{
/* Print i number of stars */
for(j=1; j<=i; j++)
{
printf("*");
}

/* Move to next line */


printf("\n");
}

return 0;
}

Output

*
**
***
****
*****
* C program to print mirrored right triangle star pattern series
*/

#include <stdio.h>

int main()
{
int i, j, rows;

/* Input rows from user */


printf("Enter number of rows: ");
scanf("%d", &rows);

/* Iterate through rows */


for(i=1; i<=rows; i++)
{
/* Print spaces in decreasing order of row */
for(j=i; j<rows; j++)
{
printf(" ");
}

/* Print star in increasing order or row */


for(j=1; j<=i; j++)
{
printf("*");
}

/* Move to next line */


printf("\n");
}

return 0;
}

*
**
***
****
*****
* Reverse right triangle star pattern program in C
*/

#include <stdio.h>

int main()
{
int i, j, rows;

/* Input number of rows from user */


printf("Enter number of rows : ");
scanf("%d", &rows);

/* Iterate through rows */


for(i=1; i<=rows; i++)
{
/* Iterate through columns */
for(j=i; j<=rows; j++)
{
printf("*");
}

/* Move to the next line */


printf("\n");
}

return 0;
}

Output

*****
****
***
**
*
/**
* C program to find sum of natural numbers from 1 to n using recursion
*/

#include <stdio.h>

/* Function declaration */
int sumOfNaturalNumbers(int start, int end);

int main()
{
int start, end, sum;

/* Input lower and upper limit from user */


printf("Enter lower limit: ");
scanf("%d", &start);
printf("Enter upper limit: ");
scanf("%d", &end);

sum = sumOfNaturalNumbers(start, end);

printf("Sum of natural numbers from %d to %d = %d", start, end, sum);

return 0;
}

/**
* Recursively find the sum of natural number
*/
int sumOfNaturalNumbers(int start, int end)
{
if(start == end)
return start;
else
return start + sumOfNaturalNumbers(start + 1, end);
}

Output

Sum of natural numbers from 1 to 10 = 55


FATHER OF C LANGUAGE

Dennis Ritchie
Bell Labs

Dennis MacAlistair Ritchie (September 9, 1941 – c. October 12, 2011)[2][3][4][5]was an


American computer scientist.[2] He created the C programming languageand, with long-time
colleague Ken Thompson, the Unix operating system.[2]Ritchie and Thompson were awarded
the Turing Award from the ACM in 1983, the Hamming Medal from the IEEE in 1990 and
the National Medal of Technology from President Bill Clinton in 1999. Ritchie was the head
of Lucent Technologies System Software Research Department when he retired in 2007. He was the
"R" in K&R C, and commonly known by his username dmr.

Das könnte Ihnen auch gefallen