Project 1 Format

Project 1 Format - fraction=num1/num2; printf("

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 DocumentRight 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(&quot; \n%20s%20s&quot;, &quot;Description&quot;, &quot;Data&quot;); printf(&quot; \n%20s%20s&quot;, &quot;-----------&quot;, &quot;----&quot;); printf(&quot; \n%20s%20d&quot;, &quot;Input 1&quot;, num1); printf(&quot; \n%20s%20d&quot;, &quot;Input 2&quot;, num2); printf(&quot; \n%20s%20d&quot;, &quot;Sum&quot;, sum); printf(&quot; \n%20s%20.1f&quot;, &quot;Half of Input 1&quot;, halfNum1); printf(&quot; \n%20s%20.1f&quot;, &quot;Half of Input 2&quot;, halfNum2); printf(&quot; \n%20s%20d&quot;, &quot;Quotient&quot;, quotient); printf(&quot; \n%20s%20d&quot;, &quot;Remainder&quot;, remainder); printf(&quot; \n%20s%20.4f&quot;, &quot;Fraction&quot;, fraction); printf(&quot; \n \n&quot;); C Programming Project 1 All programs will begin with this heading return 0; }...
View Full Document

Page1 / 3

Project 1 Format - fraction=num1/num2; printf(&amp;amp;quot;

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