You are on page 1of 1

COMP 206: Homework 1

Due on Monday, January 30th, 2012 at 11:30am (1) In your user home directory, create a subdirectory for your homework, you can name it as "homework" directory. (2) (a) Under the homework directory, use vi editor to create a main.c file with the input as below: #include <stdio.h> void main() { printf{"Hello World!\n"}; } (b) Then compile the file and generate a.out. Which command do you use? If you want to use the main.c to generate a executable file called hello_world, which compile command do you use? (c)Rename your main.c file to hello_world.c, which command do you want to use? (3) Write a program to print the ASCII code of character '9'. (4) Write a program to receive a lower case letter from the standard input, and your program will do the following things: (a) Judge if the program received correct lower case letter (i.e., a-z) from the standard input. (b) Make the program print the corresponding capital letter of the input.

You might also like