
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The key points in these lecture slides of intro to computer programming are given as:C Programming Basics, Subset of C , Keywords in C and C , Names of Variables, Keyword List, Program Structure in C, Comment Statements, Pre-Processor Directives, Example Declarations, Data Types
Typology: Slides
1 / 32
This page cannot be seen from the preview
Don't miss anything!

























Lecture 5
switch template this throw try typedef union unsigned virtual void volatile while
new operator private protected public register return short signed sizeof static struct
double else enum extern float for friend goto if inline int long
asm auto break case catch char class const continue default delete do
#include -- header files for library functions
Example: #include <stdio.h>
#define -- define constants and macros Examples: #define e 2. #define pi 3.
Note Space
Note Spaces
plotxy (x, y) ;
x = (5. / 2 + 6) * 7 ;
% remainder, where:
x = 13 % 5 ; /* x will be equal to 3 */
For example:
x = 2 * 3 - (4 + 5) + 8 % 7;
x = 2 * 3 - 9 + 8 % 7;
x = 6 - 9 + 8 % 7;
x = 6 - 9 + 1;
x = -3 + 1;
x = -2; Docsity.com
Another example:
x = x = (^) 33; 6 / 2 + 1 - 3 + 8 * 4;
x = 6 / (2 + 1) - (3 + 8) * 4;
x = -42;
Operator: Example: Meaning:
= x = 5 ; x = 5 ; += x += 5 ; x = x + 5 ; –= x –= 5 ; x = x – 5 ; /= x /= 5 ; x = x / 5 ; *= x *= 5 ; x = x * 5 ; %= x %= 5; x = x % 5 ;
Example of assignment operators:
int a = 4, b = 2, c = 36 ; a += b ; /* This adds b to a, a =? */
c /= a + b ; /* What is value of c now? */