NO

Poll

showing me this warning error : missing prototype

good
0 (0%)
bad
0 (0%)

Total Members Voted: 0

Voting closed: May 19, 2010, 01:16:05 PM

Author Topic: missing protoptype  (Read 2458 times)

cyclops

  • Guest
missing protoptype
« on: May 16, 2010, 01:16:05 PM »
/*         warning #2027: Missing prototype for 'printline'.
              Missing prototype for 'value'.
*/


#include<stdio.h>
void value();
int main()
{
   void printline();
    void value();
   void printline();
}
void printline()
{
   for(int i=0;i<20;i++)
      printf("%c",'-');
   printf("\n");
}
void value()
{
   float principal,inrate,sum;
   int period,year;
   printf("Enter principal, inrate, year :\n");
   scanf("%f%f%d",&principal,&inrate,&period);
   sum=principal;
   year = 1;
   while (year<=period)
   {
      sum =sum*(1+inrate);
      year++;
   }
   printf("%f\t%f\t%f\n",principal,inrate,sum);
   
}

Offline Vortex

  • Member
  • *
  • Posts: 867
    • http://www.vortex.masmcode.com
Re: missing protoptype
« Reply #1 on: May 16, 2010, 01:22:43 PM »
You should not place those prototypes in the main function. They should come like the following :
Code: [Select]
#include<stdio.h>

void printline();
void value();
void printline();
.
.
.
Code it... That's all...