Docsity

Computer Programming in C: Course Structure, Basics, and First Program, Exercises of Computer science

Partial preview of the text

Download Computer Programming in C: Course Structure, Basics, and First Program and more Exercises Computer science in PDF only on Docsity!

Computer Programming

R. Jothi

Computer Engineering

SOT PDPU

Overview

  • Course Structure
  • Why this course?
  • (^) Basics of Computer System
  • (^) Program/Software
  • (^) Introduction to C Language
  • Turbo C Compiler
  • C Program Example
  • (^) Text Books

Why this course?

  • Increase your employability in IT sector
  • Implementing Control Systems better
  • (^) Understanding Computer Architecture become easy
    • (^) Design microcontrollers
  • Embedded C Programmer - (^) LED program for lighting it, is easily written using

Embedded C

“Every electrical engineer have to do at least some

embedded programming at some point in their careers”

C.P.U.

KEYBOARD

MONITOR
C.U.
A.L.U.

Cache

Memory

Primary Memory

ROM
RAM

Auxiliary Memory

Floppy Disks

Hard Disk

CD/Pen Drive

Text Books

  • Programming in ANSI C,

Balagurusamy

  • (^) Let Us C, Yashavant

Kanetkar

  • (^) C: The Complete

Reference, Herbert Schildt

HISTORY OF C

  • (^) The C programming language was designed by

Dennis Ritchie at Bell Laboratories in the early 1970s

ANSI standard in 1999

USE OF C

• OPERATING SYSTEMS
• EDITORS
• COMPILER CONSTRUCTION
• INTERPRETERS
• ASSEMBLERS
• DBMS/RDBMS
• APPLICATION SOFTWARE
• GENERAL-PURPOSE SOFTWARE

STEPS FOR WRITING A PROGRAM

PROGRAM

INSTRUCTION INSTRUCTION INSTRUCTION

CONSTANTS

VARIABLES

KEYWORDS

ALPHABETS DIGITS

SPECIAL

SYMBOLS

C CHARACTER SET

  • (^) ALPHABETS : A … Z , a … z
• DIGITS : 0 … 9
• SPECIAL
SYMBOLS : ~ `! @ # % ^
& * ( ) _ - + =
| \ { } [ ]:

A Simple C Program to display “Hello Electrical Engineers”

/ This is my first program /

#include <stdio.h>

void main()

{

printf(“Hello Electrical Engineers”);

}

Source

Code

Hello.c

Turbo C

  • Integrated Development Environment and Compiler

for the C programming Language

  • (^) How to open it

     Run -> 
    • Type C:\TC\BIN\TC.EXE

First program in Turbo C

**1. Open Turbo C

  1. Type the program
  2. Save the file as Hello.c**

Use Key F

4. Compile the program

Use ALT + C

5. Run the program

Use ALT + R