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

c-lecture1

The document provides important course information for CMPE152 - Computer Programming at İstanbul Okan University, including course hours, grading distribution, and supplementary materials. It outlines the objectives of the course, which are to teach programming in C and the use of data structures and programming techniques. Additionally, it includes a brief history of the C programming language, its popularity, and instructions for running C programs on various platforms.

Uploaded by

ahmeayyad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

c-lecture1

The document provides important course information for CMPE152 - Computer Programming at İstanbul Okan University, including course hours, grading distribution, and supplementary materials. It outlines the objectives of the course, which are to teach programming in C and the use of data structures and programming techniques. Additionally, it includes a brief history of the C programming language, its popularity, and instructions for running C programs on various platforms.

Uploaded by

ahmeayyad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Asst. Prof.

Zeynep TAVUKOĞLU ŞAHİN

Email
[email protected]

İstanbul Okan University


2023-2024 Fall
Important Course Information

vCourse Hours
vMaterials and Resources
vDistribution of Grade
Elements
vSyllabus
vThe Method of Course
Course Code / Name:

CMPE152 - Computer Programming

Course Schedule :
Wednesday - LAB1

Face-to-face Lesson :
Section1 à 09:00 – 12:50
Section2 à13:00 – 16:50
Supplementary Materials:

Algoritma Geliştirme ve Programlamaya Giriş, Fahri


Vatansever, SEÇKİN

Uygulamali C Programlama Dili, Bora Tunçer, PAPATYA

Programlama Dilleri: C ile Programlama, Dr.Yalçın


Özkan, ALFA

C How to Program, Deitel, Paul J., Deitel, Harvey M.,


Pearson Education

The C Programming Language, Brian W. Kernighan &


Dennis M. Ritchie, PRENTICE HALL PTR
Distribution of Grade Elements:

ØMidterm Exam %30,

ØFinal Exam %40,

ØQuiz 1 and Quiz 2 %20

ØClass performance and class participation


%10

I will uploaded the syllabus in the O’learn


system.
There are two purposes to this course;

§ to teach you to program in the C


programming language,

§ to teach you how to choose, implement,


and use data structures and standard
programming techniques.
This course outline;

§ Basic information about programming

§ Basic operations in programs

§ Mathematical, comparison and logical


operations
Computer languages are broadly classified as:

Low Level Language: The term low level highlights the fact that it is
closer to a language which the machine understands.

o Machine Language : It is the 1st generation language. Here the


instructions were written in binary form and is referred to as low
level language.

o Assembly Language : It’s the second generation labguage. Here


the instructions are written with symbolic instructions. It is low-level
language.
• High Level Language: Low level language requires extensive knowledge of
the hardware since it is machine dependent.

• To overcome this limitation, high level language has been evolved which uses
normal English, which is easy to understand to solve any problem. High level
languages are computer independent and programming becomes quite easy
and simple.

o BASIC
o COBOL
o FORTRAN
o C
o C++
INTRODUCTION TO “C”
Brief History of C
² The C programming language is a structure oriented programming language,
developed at Bell Laboratories in 1972 by Dennis Ritchie.

² C programming language features were derived from an earlier language


called “B” (Basic Combined Programming Language – BCPL)

² C language was invented for implementing UNIX operating system.

² In 1978, Dennis Ritchie and Brian Kernighan published the first edition “The C
Programming Language” and is commonly known as K&R C.

² In 1983, the American National Standards Institute (ANSI) established a


committee to provide a modern, comprehensive definition of C. The resulting
definition, the ANSI standard, or “ANSI C”, was completed late 1988.

² Many of C’s ideas & principles were derived from the earlier language B,
thereby naming this new language “C”.
WHY IS C POPULAR ?
² It is reliable, simple and easy to use.
² C is a small, block-structured programming language.
² C is a portable language, which means that C programs
written on one system can be run on other systems with little
or no modification.
² C has one of the largest assortments of operators, such as
those used for calculations and data comparisons.
² Although the programmer has more freedom with data
storage, the languages do not check data type accuracy for
the programmer.
vC is a powerful general-purpose
programming language. It is fast, portable
and available in all platforms.
v If you are new to programming, C is a
good choice to start your programming
journey.
You can install on your personal computer one of
the programs listed below:
Ø Dev C++ (on windows platform)
Ø C Online Compiler (with browser)
Ø Xcode (on Macbook)
Ø Visual Studio
Ø Eclipse
Ø Visual Studio C++ Express Edition
Ø Netbeans
Ø Code Blocks
COMPILE AND RUN C PROGRAMMING ON YOUR COMPUTER

There are numerous compilers and text editors you


can use to run C programming. These compilers and
text editors may differ from system to system.

vRun C Programming in Mac OS X


I think that the most comfortable program is Eclips
or Xcode
vRun C Programming in Windows
I think that the most comfortable program is Eclips
or Dev C ++
vRun C Programming in online
https://www.onlinegdb.com/online_c_compiler
Operation Operator Example
Addition + a+b
Subtraction - a-b
Multiplication x a*b
Division ÷ a/b
Modulus % a%b

Process Priority
Operations
1 Parentheses (…)
2 Functions cos, sin, ln, log
3 Multiplication and Division a*b and a/b
4 Addition and Subtraction a+b and a-b

from left to right


C LIBRARY FUNCTION - POW() AND SQRT()
ØThe C library function pow(x,y) returns x raised to
the power of y i.e. xy.
x − This is the floating point base value. y − This is
the floating point power value.

vC sqrt()
The sqrt() function computes the square root of a
number.

The C library function sqrt(x) returns the square root


of x.
Find the equations in the C computer language of the following
mathematical expressions.
a.) 𝑎 + 𝑏 − 𝑐 + 2𝑎𝑏𝑐 − 7

b.) 𝑎 + 𝑏 ! − 𝑐 "

!#$
c.) 𝑎 + 𝑏 −
$! %&#'

#! ($!
d.) !#$

$(' !
e.) 𝑎 + "#$
)( %&

Bilgisayar Programlama - 2020 5.10.2023


Find the values of following three statements for a=4, b= 6, c=8 and d=10
a.) 𝑐 ∗ 𝑑/(𝑎 ∗ 𝑑) + 𝑏 + 𝑐 ∗ 𝑑/𝑎

b.)𝑐 ∗ 𝑑/𝑎 ∗ 𝑑 + 𝑏 + 𝑐 ∗ 𝑑/𝑎

c.)𝑐 ∗ 𝑑/𝑎 ∗ 𝑑 + (𝑏 + 𝑐) ∗ 𝑑/𝑎

Bilgisayar Programlama - 2020 5.10.2023


Find the values of following three statements for a=1, b= 2, c=3, d=4 and
e=-2

a.) 𝑎 + 𝑑/𝑏 + 𝑝𝑜𝑤 𝑑, 2 + 2 ∗ 𝑎 ∗ 𝑏 ∗ 𝑐/𝑑 + 𝑒

b.)(𝑎 + 𝑏)/𝑐 + 𝑝𝑜𝑤 𝑑, 2 + 2 ∗ 𝑎 ∗ 𝑏 ∗ 𝑐/(𝑑 + 𝑒)

Bilgisayar Programlama - 2020 5.10.2023


Find the values of following three statements for a=-1, b= 7, c=4, d=2 and
e=6

a.) a + b + 𝑐/𝑑 + 𝑑 − 𝑝𝑜𝑤 𝑒, 2 + 𝑐 + 𝑒 + 𝑑/𝑝𝑜𝑤(𝑏 − 𝑒, 1/2)

b.)(a + b + 𝑐)/𝑑 + 𝑑 − 𝑝𝑜𝑤 𝑑 − 𝑒, 2 + (𝑐 + 𝑒 + 𝑑)/𝑝𝑜𝑤(𝑏 − 𝑒, 1/2)

Bilgisayar Programlama - 2020 5.10.2023

You might also like