Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Programming in C language full summary notes

Rating
-
Sold
-
Pages
33
Uploaded on
16-12-2022
Written in
2022/2023

This document consists of summary of the book programming with C by Byron Gottfried (SCHUAM'S OUTLINES). It is made with simple language for both beginners and advanced C programmers. examples are given for each and every topic with various C programs to practice and understand the concept in depth. these notes are very helpful for last minute revision for any C programming exam.

Show more Read less
Institution
Course

Content preview

CH1: INTRODUCTORY CONCEPTS

❖ Dig comp is an electronic programmable machine that can process all kinds of
data using some set of instructions called programs
❖ BLOCK DIAGRAM OF A COMP




Has 4 main components: input & output devices, memory and CPU
➢ INPUT UNIT
▪ Used to input data to comp via input devices like keyboard, scanner,
microphone etc.
▪ It accepts data & instructions from the outside world
▪ Converts it to binary form which a comp can understand
▪ Sends the converted data to comp system for further processing
➢ OUTPUT UNIT
▪ The computed result is then displayed to the outside world via output
devices like monitor, printer, speaker etc.
➢ STORAGE UNIT
▪ It stores the input data for processing & displaying the output and it also
saves the data for later use
▪ Classified into 2 types: primary and secondary memory
▪ Primary memory: faster, less storage(MB), expensive ; volatile in nature
ie data is lost once the comp is switched off & in order to store, it must
be transferred to sec mem ; consists of RAM & ROM ; RAM-consists of
all temp data used by CPU, CPU can process only the data present in the
RAM ; ROM- very small memory used for booting process

, ▪ Secondary memory: slower, huge storage(GB), cheap ; permanent in
nature and doesn’t get lost after switching off the comp ; eg-hard disk,
CD etc.
➢ CPU
▪ CU+ALU
▪ Brain of the comp
▪ Performs all cal
▪ Takes all decisions
▪ Controls all units of comp
➢ MEMORY SIZE
▪ Dig comp use binary system ie 0 & 1
▪ Each char/no is rep by 8-bit code = byte
▪ Size of primary memory usually in KB & MB
▪ 1 KB = 1024 bytes & 1 MB = 1024 KB
❖ Bcoz of comp extreme speed, it can carry out cals within mins which req
months or years if carried out by hands ie time req to do simple cal like
addition is usually rep in terms of microseconds ; this very high speed is
accompanied by equally high level of reliability ie comp can never make
mistakes on their own and error occurs only due to wrong instructions/data
❖ C lang
➢ General purpose programming lang
➢ Very popular and powerful despite being old
➢ Fast compared to java & python
➢ Very versatile & small size
➢ C++ is extension of c ; diff – it supports classes and objects
➢ Extensive use of fun calls & pointers
➢ Structured & case sensitive lang
❖ Comp hardware: refers to physical components ; any part of comp that we can
touch ; primary electronic devices used to build up the comp ; eg-monitor,
mouse, keyboard, printer, scanner, CPU etc.
❖ Comp software: collection of instructions , procedures, programs that perform
diff tasks on comp system ie programming code executed on processor ; can

, be machine level code / code written for OS ; eg-MS word, excel, ppt, google
chrome, photoshop etc.
❖ OS: software helps user to operate comp efficiently; acts as interface bet comp
& user since it understands only binary lang; eg-DOS (disk), windows OS,
unix/linux OS
❖ Compiler: software that translates programs written in high level lang(source
program) to machine lang(object program) ; eg-C-compiler, java-compiler etc.

CH4: DATA INPUT AND OUTPUT

❖ getchar, putchar, scanf, printf, gets and puts functions permit the transfer of
info bet comp & std i/o devices
❖ Header file req for std i/o lib fun = <stdio.h>
❖ getchar() function
➢ input fun used for entering single char usually from keyboard
➢ does not req arg but parentheses() r must
➢ char var = getchar();
➢ return type is char
❖ putchar() function
➢ output fun used for displaying single char usually on monitor
➢ arg must be specified within ()
➢ putchar(char var);
➢ return type is int (ASCII value)

eg for both:

#include<stdio.h>

int main()

{

char c;

printf("enter a character: ");

c=getchar();

, printf("you entered: ");

putchar(c);

return 0;

}

❖ scanf() function
➢ input fun used for entering any comb of numerical values, single chars &
strings in memory address using ampersand&
➢ data type must be provided using format specifiers ie %d%f%c etc.
➢ scanf(“format specifiers”, &arg1, &arg2…);
➢ the format specifiers must respectively match its arg & array name cannot
begin with &
➢ max field width can be used with the format specifier ie %3d %.4f etc.
however char exceeding the field width will be considered for the next data
item
➢ whitespace is also considered as newline char
➢ assignment suppression ie %*d used for skipping the data item
➢ unrecognized char r skipped
❖ printf() function
➢ output fun used for displaying any comb of numerical values, single chars &
strings
➢ can be simply used to print any message on the screen
➢ printf(“format specifiers”, arg1, arg2…);
➢ & not used since printf() has nothing to do with memory addresses
➢ Min field width can be used with the format specifier ie %3d %.4f etc.
however char less than it will be filled with blank spaces
➢ Unrecognized char r printed just like that

eg for both:

#include<stdio.h>

int main()

Connected book

Written for

Institution
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
Chapter 1,4,5,6,7,8,9,10,11,12,13
Uploaded on
December 16, 2022
Number of pages
33
Written in
2022/2023
Type
SUMMARY

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
rdivya

Get to know the seller

Seller avatar
rdivya Justice Basheer Ahmed Sayeed college for women
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions