CS341 - Intro. to Computer Architecture and Organization - Professor Ackley

Tuesday and Thursday: 9:30am - 10:45am (Centennial 1028) Lab: Friday 2:00pm - 2:50pm (Centennial B146)

C Introduction

Goals

  • TA Introduction
  • Class details
  • (re)Become familiar with Emacs and programming in C
  • Write a HelloClass.c - Compile with gcc (GNU Compiler Collection) and run
  • Complete number conversion worksheet

Instructions

Create a HelloClass.c file and compile with gcc. It should be incredibly basic and just get you back into:

  • Creating .c files
  • Coding in Emacs (:$ C-h t for the tutorial)
  • Compiling .c files into output files and running them

The output shall print your:

  1. Name
  2. Hobby
  3. Age at which you wrote your first program (using octal)
  4. Favorite thing about UNM

all on different lines. Here's an example:

Name: Brady Key
Hobby: Photography
Age when first program was written: 18
Favorite thing about UNM: Lobo Basketball Team


The next part of this lab is to get you some more practice with converting numbers from different bases (i.e. decimal to binary to octal to hexadecimal to base 10 to base -5 etc.) Complete the assigned worksheet and turn it in by the end of the lab to get credit for attending.