次のプログラムの下線部を別関数にしてプログラムを作成しなさい。
【問1】
#include <stdio.h>
int main( void )
{
putchar( '*' );
return 0;
}
|
【問2】
#include <stdio.h>
int main( void )
{
char n;
n = '*';
putchar( n );
return 0;
}
|
【問3】
#include <stdio.h>
int main( void )
{
int a, b , c;
a = 20;
b = 10;
c = a * b;
printf( "c = %d\n", c );
return 0;
}
|
【問4】
#include <stdio.h>
int main( void )
{
int a, b, c;
puts( "二つの整数値を入力 " );
scanf( "%d %d", &a, &b );
if ( a <= b ) {
c = a;
}
else {
c = b;
}
printf( "小さい方 = %d\n", c );
return 0;
}
|
▼戻る▼
「初心者のためのポイント学習C言語」 Copyright(c) 2000-2004 TOMOJI All Rights Reserved