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

Data Structure and Algorithm Slide

C programming language was developed in the early 1970s at Bell Labs by Dennis Ritchie to be used for Unix operating system development. In 1978, Brian Kernighan and Dennis Ritchie published The C Programming Language, which became the formal standard reference for C. Sample C programs are presented to demonstrate basic input/output functions like printf and scanf, as well as variable declaration and data types.

Uploaded by

Nba's Best
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Data Structure and Algorithm Slide

C programming language was developed in the early 1970s at Bell Labs by Dennis Ritchie to be used for Unix operating system development. In 1978, Brian Kernighan and Dennis Ritchie published The C Programming Language, which became the formal standard reference for C. Sample C programs are presented to demonstrate basic input/output functions like printf and scanf, as well as variable declaration and data types.

Uploaded by

Nba's Best
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

DATA STRUCTURE AND ALGORITHM

(FOR CMU-CET STUDENTS)


INTRODUCING C LANGUAGE

• HISTORY OF C LANGUAGE
C Programming Language came out of Bell Labs in the
early 1970. Dennis Ritchie develop C Language according
to the Bell Labs paper. C Language was used for Unix
operating system. But before the C language development,
a B Programming was developed by Ken Thompson. Due
to slow nature of B in the Operating System this led to the
development of C.
PUBLICATION OF THE C PROGRAMMING LANGUAGE

• In 1978 Brian Kernighan and Dennis Ritchie published The C


Programming Language as a formal standard reference. Five
years later the American National Standard Institute (ANSI)
formed the committee X3J11 for standard C.
• Unix and Linux were written in C and Databases such Oracle,
MySQL, MS SQL Server partially written in C. Other programming
languages like Python and Perl use compilers that are written in
C.
• The language also made way for C++, Objective-C, C# and many
more C-based Languages that each have their own specialty.
Sample programs in C Language (disecting)

SAMPLE PROGRAM # 1
#include <stdio.h>
main()
{
printf(“Hello to today’s NEW NORMAL\n ”);
printf(“CMU-CET face the challenge of On-line Education!”);
return 0;
}
Output:
Hello to today’s NEW NORMAL
CMU-CET face the challenge of On-line Education!
DISECTING:

- #include is a preprocessor command that tells the compiler to include the


contents of stdio.h (standard input/output.header)
-stdio.h file contains functions such as scanf() and and printf() function.

-main() - the execution of a C programs starts from main() function.


-{ - start the body of the program
-printf() function - to display Hello to today’s NEW NORMAL
-printf() function- to display CMU-CET face the challenge of On-line
Education!
-return 0; - Exit Status
-} - end body of the program
Program using SCANF AND PRINTF FUNCTION

SAMPLE PROGRAM # 2
#include <stdio.h>
int main()
{
int num1;
printf(“enter a number: “);
scanf(“%d”, &num1);
printf(“you enter number: “,num1);
return 0;
}
Declaration of DATA TYPE and VARIABLE
SAMPLE PROGRAM #3

#include <stdio.h>
int main()
{
char Sname;
int quiz1, quiz2;

printf(“Please input your name: “);


scanf(“%c”,&Sname);
printf(“Input your first quiz: “);
scanf(“%d”,&quiz1);
printf(“Your first quiz score is %d : “,quiz1);
printf(“Input your second quiz: “);
scanf(“%d”,&quiz2);
printf(“Your second quiz score is %d : “,quiz2);
return 0;
}

You might also like