100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Programming in C language full summary notes $7.99   Add to cart

Summary

Programming in C language full summary notes

 12 views  0 purchase
  • Course
  • Institution
  • Book

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...

[Show more]

Preview 4 out of 33  pages

  • No
  • Chapter 1,4,5,6,7,8,9,10,11,12,13
  • December 16, 2022
  • 33
  • 2022/2023
  • Summary
avatar-seller
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()

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller rdivya. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75619 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart