Thread: beginners error

  1. #1
    Registered User
    Join Date
    Mar 2013

    beginners error

    I am
    new to programming in c and my task is to write a simple program that is able to compute the area under a curb using the trapezoidal rule. I wrote the program but it will not compile, the error I m getting is:
     expected expression before } token
    project1.c:24: error: expected ; before numeric constant
    and this are my codes:
    #include <stdio.h>
    int main(void)
             int a, b, N,h,i,counter,A;
     printf(" enter the interval a and b");
     scanf("%d\n%d\n", &a, &b);
     prinf("enter the number of trapezoids you would like to  use");
            scanf("%d\n", &N);
     h= (b-a)/N;
     while((h*((i*i)+(counter*counter))/N) <= N){
                      for(i=a; i<=b; i++)
                               for(counter=a; counter=b; counter++){
    printf("the area under the curb from %d to %d is: %d", a, b, A);
    counter 0;

  2. #2
    Registered User
    Join Date
    May 2010
    Duplicate already asked here.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginners, C++ or C#?
    By Zeusbwr in forum C++ Programming
    Replies: 30
    Last Post: 10-10-2004, 10:54 PM
  2. Beginners ERROR!!!
    By Game_Addict27 in forum C++ Programming
    Replies: 7
    Last Post: 08-21-2004, 08:56 AM
  3. GUI for beginners
    By Micko in forum C++ Programming
    Replies: 6
    Last Post: 06-24-2004, 05:40 AM
  4. Beginners FAQ
    By Lurker in forum A Brief History of
    Replies: 15
    Last Post: 04-14-2004, 07:32 PM
  5. beginners help
    By stormswift in forum C Programming
    Replies: 5
    Last Post: 02-11-2002, 03:44 PM