Lab4 - ,year); return 0; } 4) #include...

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

View Full Document Right Arrow Icon
Tao Lin EE140 Lab4 2) #include <stdio.h> int main( void ) { int a,b; printf( "Enter two integers: " ); scanf( "%d%d" ,&a,&b); if (a>b) printf( "%d is larger than %d\n" ,a,b); else if (a==b) printf( "Two numbers are equal.\n" ); else printf( "%d is larger than %d\n" ,b,a); return 0; } 3) #include <stdio.h> int main( void ) { int year; printf( "Enter the year: " ); scanf( "%d" ,&year); if printf( "%d is a leap year.\n" ,year); else printf( "%d is NOT a leap year.\n"
Background image of page 1

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

View Full DocumentRight 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: ,year); return 0; } 4) #include &lt;stdio.h&gt; int main( void ) { int a,min; printf( &quot;Enter the 1st integer: &quot; ); scanf( &quot;%d&quot; ,&amp;min); printf( &quot;Enter the 2ed integer: &quot; ); scanf( &quot;%d&quot; ,&amp;a); if (min&lt;=a) ; else min=a; printf( &quot;Enter the 3rd integer: &quot; ); scanf( &quot;%d&quot; ,&amp;a); if (min&lt;=a) ; else min=a; printf( &quot;The minimum is %d.\n&quot; ,min ); return 0; }...
View Full Document

Page1 / 2

Lab4 - ,year); return 0; } 4) #include...

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