HW #3 - break default printf"Entered number...

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

View Full Document Right Arrow Icon
Jince Jacob Section #1 C Programming 9-16-07 Problem #2 #include<stdio.h> int main(void) { int choice; printf("How many asteriks do you want?(1-6)\n"); scanf("%i", &choice); switch(choice) { case 1: printf("*"); break; case 2: printf("**"); break; case 3: printf("***"); break; case 4: printf("****"); break; case 5: printf("*****"); break; case 6: printf("******");
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
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: break; default: printf(&amp;quot;Entered number must be between 1-6&amp;quot;); break; } return 0; } Problem #3 #include&amp;lt;stdio.h&amp;gt; int main(void) { int i; int d; int j; for(i=1; i&amp;lt;8; i=i+2) { for(d=7-i; d&amp;gt;0; d=d-1) { printf(&amp;quot; &amp;quot;); } for(j=i; j&amp;gt;0; j=j-1) { printf(&amp;quot;*&amp;quot;); printf(&amp;quot; &amp;quot;); } printf(&amp;quot;\n&amp;quot;); } return 0; }...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

HW #3 - break default printf&amp;quot;Entered number...

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

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