What is the output?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void a( int i );
void b( int i );
void c( int i );
int main( void )
{
int i;
srand( time( 0 ) );
i = (rand( ) % 3) + 1;
switch( i )
{
case 1:
a( i );
break;
case 2:
b( i );
break;
case 3:
c( i );
break;
default:
printf( "bad i value! i = %d\n", i );
break;
}
return 0;
}
void a( int i )
{
printf( "Inside a: i = %d\n", i );
}
void b( int i )
{
printf( "Inside b: i = %d\n", i );
}
void c( int i )
{
printf( "Inside c: i = %d\n", i );
}
UMBC |
CSEE |