【問1】
#include <stdio.h>
void func( void );
int main( void )
{
func();
return 0;
}
void func( void )
{
putchar( '*' );
return;
}
|
【問2】
#include <stdio.h>
void func( char s );
int main( void )
{
char n;
n = '*';
func( n );
return 0;
}
void func( char s )
{
putchar( s );
return;
}
|
|
【問3】
#include <stdio.h>
int mul( int x, int y );
int main( void )
{
int a, b, c;
a = 20;
b = 10;
c = mul( a, b );
printf( "c = %d\n", c );
return 0;
}
int mul( int x, int y )
{
int z;
z = x * y;
return z;
}
|
【問4】
#include <stdio.h>
int min( int x, int y );
int main( void )
{
int a, b, c;
puts( "二つの整数値を入力 " );
scanf( "%d %d", &a, &b );
c = min( a, b );
printf( "小さい方 = %d\n", c );
return 0;
}
int min( int x, int y )
{
if ( x <= y ) {
return x;
}
else {
return y;
}
}
|
▼戻る▼
「初心者のためのポイント学習C言語」 Copyright(c) 2000-2004 TOMOJI All Rights Reserved