Esc101: Fundamentals of Computing Esc101: Fundamentals of Computing
Esc101: Fundamentals of Computing Esc101: Fundamentals of Computing
Esc101: Fundamentals of Computing Esc101: Fundamentals of Computing
Announcements
Monday lab scheduled on 15th August will instead be held on Saturday, 20th August. Monday lab scheduled on 22nd August will instead be held on Saturday, 27th August. Wednesday lab scheduled on 31st August will instead be held on Saturday, 3rd September.
Lec-09
Recap
Loops
while statement for statement
Lec-09
Character
char data type One byte of memory Stores a single character
char c; c = a; c = 1;
Lec-09
Lec-09
Character Representation
Cannot assume a specific character representation in your program But you can assume that
All small case letters will be stored as consecutive numbers
The difference in z and a will always be 25
Lec-09
Printing a character
%c is used to indicate to printf that a character is to be printed. printed
char gender; gender = M; printf (The gender is: %c\n, gender);
Reading a character
%c is used to indicate scanf that a single character is to be read.
scanf (%c, &c)
Lec-09
Lec-09
Lec-09
11
Lec-09
Lec-09
13