C Programming COP 3223 lecture 1. Raja Iqbal. About Myself. Graduate Student at the School of EECS Areas of Interest are Image Compression, Signal Processing, Hardware and ASIC Design and FPGA Architectures Work Experience Graduate Research Assistant, School of EECS
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
C ProgrammingCOP 3223lecture 1
On completion of this syllabus you should be able to
There are millions of books on C Programming. I will name few that I like.
The following will be the output of the Hello World program
Variable names are example of identifiers.They have the following rules:
Are they the same?
Whole number types
long int or long
Floating point types
long num_records = 0;
double length = 3.7, width = 2.7;
What is 5 divided by 2?
printf("There are %d people here.\n", num_people);
%d for integer
%efor float in scientific notation
%ffor float in decimals
%gchooses %e or %f format for you
%cfor ASCII character
%lefor a double in scientific notation
%.2ffor float to 2 places of decimals
\% or %%for literal % sign
\"for literal "
\nfor new line
\\for literal backslash
scanf("%d %f", &my_int, & my_float);
x + 2;
y = x + 2;
a = 5 + b = c * 2;
1. Include stdio.h and declare main
2. Declare space for variables
3. Input the value in centigrade
4. Do the calculation
5 Output the answer.
void main (void)
float cent, fahr;
printf("Enter temperature in Centigrade\n");
fahr = cent * 9/5 + 32;
printf("In Fahrenheit this is %.2f degrees\n",fahr);
instead write a+= b;
instead write a++ or ++a
Order in which arithmetic operations are evaluated
unsigned int population;
x = (int) y;
Note that this truncates and does not round