First i call getchar() and enter some character on standard input/output , because scanf() can also fetch these characters , i want to empty the buffer , before calling scanf() , here is the program.
int main()
  {
    getchar();   // i input some characters here , "abcdefgh" 
    ------ // here i need some statement that will empty standard input/output.
    int a;
    scanf("%d",&a);  // so if buffer is empty, this prompt me to enter chacter.
                                    // if i enter 7 
    printf("%d",a);                // this should print 7
    }
 
     
     
    