Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS1010E Programming Methodology. POH YEE HUI Electrical Engineering Year 3

Similar presentations


Presentation on theme: "CS1010E Programming Methodology. POH YEE HUI Electrical Engineering Year 3"— Presentation transcript:

1 CS1010E Programming Methodology

2 POH YEE HUI Electrical Engineering Year 3 yhpoh91@nus.edu.sg

3 MinGW Unix Shell Emulator Commands: –cd:Change Directory (folder) –ls:LiSt files –mkdir:MaKe DIRectory (folder) –rmdir:ReMove DIRectory (folder) –cp:CoPy (copy and paste) –mv:MoVe (cut and paste + rename) –rm: ReMove (delete)

4 Vim Text Editor Commands –vim program.c (in MinGW):Open program.c file using Vim –i:Insert mode –v:Visual mode (for selection/highlight) –Esc:Command mode –y:Yank (copy) –x:Cut –p:Paste

5 Skeleton Template #include “stdio.h” int main() { // your code return 0; }

6 Output (printf) printf(“%d \n”, variable); New lineVariable Name Format Specifier %d : integer %lf : double (long float) %c : character %s : string

7 Input (scanf) scanf(“%d”, & variable); Variable NameFormat Specifier %d : integer %lf : double (long float) %c : character %s : string

8 Operations (+ - * /) circumference = 2 * 3.142 * radius;

9 Task 1: Distance 1 km = 1.609 miles Convert km to miles Display distance in miles (output) Get distance in km (input)

10 Task 2: Sum Get the sum of the integers Display the sum (output) Get 2 integer (input)

11 Good Luck!! Have Fun!! Poh Yee Hui yhpoh91@nus.edu.sg


Download ppt "CS1010E Programming Methodology. POH YEE HUI Electrical Engineering Year 3"

Similar presentations


Ads by Google