Characters Count From Input C Program

    Program 1:

    #include 
    main(){
    	long number_of_character;
    	number_of_character=0;
    	clrscr();
    	while(getchar()!=EOF)
    		++number_of_character;
    	printf("%d\n",number_of_character);
    
    	getch();
    }
    

    Program 2:

    #include 
    main()
    {
    	double number_of_character;
    	clrscr();
    	for(number_of_character=0; getchar() != EOF; ++number_of_character)
    	;// dont forget this special semicolon
    		printf("%.0f\n",number_of_character);
    	getch();
    }
    

    Output

    Characters Count C Program

    Characters Count C Program