โค้ด: เลือกทั้งหมด
#include <stdio.h>
#include <conio.h>
// function variable
void mul_pro();
// sub program
void mul_pro()
{
clrscr();
int i,n;
printf("Mother Multiplication \n");
printf("enter number : ");
scanf("%d",&n);
clrscr();
printf("== %d == \n",n);
for(i=0; i<=n; i++)
{
printf("%d x %d = %d \n",n,i,n*i);
}
}
// main program
void main()
{
// data type variable
int c;
printf("1 : Multiplication Program \n");
printf("select program : ");
scanf("%d",&c);
if(c == 1)
{
mul_pro();
}
}
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
test.c:
Error E2140 test.c 17: Declaration is not allowed here in function mul_pro
Warning W8065 test.c 47: Call to function 'mul_pro' with no prototype in function main
*** 1 errors in Compile ***
Output completed (0 sec consumed) - Normal Termination