Assignment 2

# Assignment 2 - scanf("%d%lf", &whole,...

This preview shows pages 1–2. Sign up to view the full content.

Assignment 2: 1). Create pico file hello-world.c /*Program name: Hello World Author: Michelle Abercrombie Date Created: January 31, 2008 This file prints the output Hello World.*/ int main() { printf("Hello World \n"); return(0); } 2). Create pico file numbers.c /*Program Name: Split Number Author: Michelle Abercrombie Date Created: January 31, 2008 This program takes a real number as input and prints out the interger and fractional part.*/ int main() { #include <stdio.h> int whole; double decimal; whole = decimal; printf("Enter a decimal number>");

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: scanf("%d%lf", &whole, &decimal); printf("The integer part is %d, and the fractional part is %8.5\$ return(0); } 3). Create pico file convert.c /*Program name: ASCII Author: Michelle Abercrombie Date created: Feburary 02, 2008 This program prints out a characters corresponding ASCII number. */ # include <stdio.h> int main() { char m; printf("Enter a character:\n"); scanf("%c", &m); printf("The corresponding ASCII value for m is %d\n", m); return(0); }...
View Full Document

## This note was uploaded on 04/03/2008 for the course ECE 175 taught by Professor Grubbs during the Spring '08 term at Arizona.

### Page1 / 2

Assignment 2 - scanf("%d%lf", &whole,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online