Thursday, 27 April 2017

ungetc

  // the following c program displays Whatever is typed by the user second time   
  #include <stdio.h>

        int main()

        {

            int n;

            scanf("%d", &n);

            ungetc(n, stdin);

            scanf("%d", &n);

            printf("%d\n", n);

            return 0;

        }

No comments:

Post a Comment