User Tools

Site Tools


archive:eec120

Computer Programming

This is an introductory course to computer programming for engineers. Knowledge of C programming is commonly accepted as of primary importance for an engineer. This knowledge can easily be translated to any other programming language.

Practical Exercise

Syllabus

  1. Introduction to Computer Systems
    1. Hardware (CPU, input, output)
    2. Software (Kernel, OS, userspace)
    3. Numbers & Logic
  2. Introduction to Computer Programming
    1. Algorithms: instruction sequencing
    2. Flow-charts: visual representation
    3. Interpreters ⇒ scripts
    4. Compiler and Linkers ⇒ binary executables
  3. Introduction to C language
    1. Basic code structure (syntax)
      1. Function and code-block
    2. Creating first executable binary
    3. Syntax (language) and semantic (decision logic) errors
    4. Variables and Operators
  4. Flow control: Branches (selection)
  5. Flow control: Loops (repetition)
  6. Arrays
  7. String (character array)
  8. Pointers
  9. Functions
    1. scopes and variable life-time
  10. File Access

Introduction to C Programming

Variable and Operators

intsize.c
#include<stdio.h>
int main(void)
{
	printf("Size of unsigned int: %d\n",sizeof(unsigned int));
	printf("Size of unsigned long long: %d\n",sizeof(unsigned long long));
	printf("Size of unsigned long: %d\n",sizeof(unsigned long));
	printf("Size of unsigned short: %d\n",sizeof(unsigned short));
	printf("Size of unsigned char: %d\n",sizeof(unsigned char));
	return 0;
}
varsize.c
#include<stdio.h>
int main(void)
{
	printf("Size of int: %d\n",sizeof(int));
	printf("Size of float: %d\n",sizeof(float));
	printf("Size of double: %d\n",sizeof(double));
	printf("Size of long double: %d\n",sizeof(long double));
	printf("Size of char: %d\n",sizeof(char));
	return 0;
}
archive/eec120.txt · Last modified: 2020/02/13 15:24 by 127.0.0.1