
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































Assoc. Prof. Dr. Tansu FİLİK
Programming Languages (Machine Code, Assembly code, high-level languages) Compiler (translator) Software development (components of algorithm) Top-Down software development Elements of C-programming language
Bil200 – Computer Programming
characters 'a' 'z' 'A' 'Z' '?' '@' '0' '9‘ Special characters are obtained using a \ sign before the indicator. \n : skip to new line \t : tab – skip 8 character spaces ' : print out ' \ : print out backslash
etc..
Exercise 3 For an average speed H, calculate the required amount of time for a travel between two locations that have distance U. Read H and U time U/H Print time
Exercise 4 Write a list of commands to read midterm, homework, and final grades of a student and calculate the total grade. The weight of final is twice of the midterm. Midterm and home work have the same weight. Read midterm, homework, and final total midterm + homework + 2*final average total / 4 Print average
i++; means i = i + 1;
j--; means j = j - 1; According to using “before” or “after” the variable, the operators may work slightly differently. i++; or ++i; do the same thing, but inherently, they work in a different manner with a different set of machine code instructions.
++k increment k by 1, and return the result to the expression that “uses” ++k. k++ use the value of k in the expression that “uses” k++, and then increment the value of k by 1. --k decrement k by 1, and return the result to the expression that “uses” --k. k-- use the value of k in the expression that “uses” k--, and then decrement the value of k by 1.
d - = 4 (d = d - 4) e *= 5 (e = e * 5) f /= 3 (f = f / 3) g %= 9 (g = g % 9) If the value of i is 5; printf( "%d", ++i ); => Prints 6 on screen printf( "%d", i++ ); => Prints 5 on screen In both cases, the value of i after execution is 6.
*Determine the values of the variables after the following lines. Do it by hand first, then try at the computer. int i, j, k; i = 2; j = 3 + i++; k = 3 + ++i; i = ++k + j--; i /= k-- + ++j;
C language has several integer types. char 8 bit short 16 bit unsigned short 16 bit int 32 bit unsigned int 32 bit long int 32 bit unsigned long 32 bit
C language has several floating point types. float 32 bit double 64 bit long double 64 bit