Project 1 Format

Project 1 Format - fraction=num1/num2 printf"\n s...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
C Programming – Project 1 All programs will begin with this heading /* Name: Date: ___________ Desc: Project 1 */ #include <stdio.h> int main(void) { int num1; int num2; int sum; int quotient; int remainder; double fraction; double halfNum1; double halfNum2; //input 1 = -9999; //input 2 = -9999; //prints a name and prompts the user for two integers printf(" \nName: _________");
Background image of page 1

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

View Full Document Right Arrow Icon
C Programming – Project 1 All programs will begin with this heading printf(" \nPlease enter two integers:"); scanf("%d%d",&num1,&num2); //performs calclulations sum=num1+num2; halfNum1=(double)num1/2; halfNum2=(double)num2/2; quotient=num1/num2; remainder=num1%num2;
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fraction=num1/num2; printf(" \n%20s%20s", "Description", "Data"); printf(" \n%20s%20s", "-----------", "----"); printf(" \n%20s%20d", "Input 1", num1); printf(" \n%20s%20d", "Input 2", num2); printf(" \n%20s%20d", "Sum", sum); printf(" \n%20s%20.1f", "Half of Input 1", halfNum1); printf(" \n%20s%20.1f", "Half of Input 2", halfNum2); printf(" \n%20s%20d", "Quotient", quotient); printf(" \n%20s%20d", "Remainder", remainder); printf(" \n%20s%20.4f", "Fraction", fraction); printf(" \n \n"); C Programming – Project 1 All programs will begin with this heading return 0; }...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

Project 1 Format - fraction=num1/num2 printf"\n s...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online