Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Sagar Adhikari
C programming
0 Answer(s)      a year and 2 months ago
Posted in : Development process


i am beginner in C my text book says getchar() and putchar() reads single character at a time and print single character respectively. but when i write following program, more than one characters are read and printed on screen. Why?please help.

#include <stdio.h>
int main(void)
{
int c;
while((c=getchar())!=EOF)
{
putchar(c);
return 0;
}

i understand that the use of while loop and EOF function is that input is allowed till ctrl Z is pressed.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
C Programming
C Programming  hi,how can i write a program in C programming to place reservation in air plane from the menu let the user to inter his/her gender(W or M)and draw seats by using ascii codes and choose where he/she will sit
programming c#
programming c#   create and make use of at least one class with appropriate instance methods to solve the programming problem. use console-based menus to navigate between the functionality offered by the application. at least one
Advertisements
c programming
c programming  how can i get the ouput in the format of a a b a b c
c programming
c programming  how can i get the ouput in the format of a a b a b c
c programming
c programming  how can i get the ouput in the format of a a b a b c
c programming
c programming  write a program to input five numbers by using while loop in c programing
C programming
C programming  i am beginner in C my text book says getchar() and putchar() reads single character at a time and print single character respectively...) { int c; while((c=getchar())!=EOF) { putchar(c); return 0; } i
c programming
c programming  Write a Program in 'C' to print the following output 'n' rows. for example, if n:3, the following should be output by the program : 1 1 2 L r 2 3 2 1 1 2 L 1
c programming
c programming  Write a Program in 'C' to print the following output 'n' rows. for example, if n:3, the following should be output by the program : 1 1 2 L r 2 3 2 1 1 2 L 1
C Programming SubString Program
C Programming SubString Program  Sir I want to Check whether the Single Substring is present in the given 3 string. characters. eg if i entered First String- CPROGRAMMING Second String- CPROGRAM third String- PROGRAMMING if i
c programming - Development process
c programming  Hello Sir, can you plz post an answer to these quesions : Write a program in c that prompts the user the name of a file... in c to create a fle, open it, type in some characters and count the number
C/C++ Programming Books
C/C++ Programming Books      ... for Visual C++ 6 programming. This book skips the beginning level material and jumps....     C++ GUI Programming
C++ programming language - Java Beginners
C++ programming language  int main() { int i = 1, c = 0, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf
c programming language - Java Beginners
c programming language  int main() { int i = 1, c = 0, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf("%d
hi need help with C++ programming!
hi need help with C++ programming!  how do i : b. Store numbers / characters into the file (output) c. Retrieve numbers / characters from the file...; "Unable to open file"; return 0; } c) #include <iostream> #include <
c programming..what wil be the output of this program
c programming..what wil be the output of this program   #include int main() { int arr[] = {0,1,2,3,4}; int i,*ptr; for (ptr=arr+4; ptr= arr; ptr--) { printf("%d",*ptr
c programming - Design concepts & design patterns
c programming  Q.1- Write a program in 'c' language to merge the contents of two binary search trees into one. Also, calculate the time and space complexities of your program? Q.2- Write a C++ program to create functions
how java programming differ from pascal and C - Java Beginners
how java programming differ from pascal and C  how Does the Java programming language differs from Procedural languages such as Pascal and C.when ýt... have to read about it for my exams thanks  Hi friend, C
C Tutorials
programming Language. C programming language is used to develop applications mostly... programming language. C Array copy example The example... C Tutorials      
Java vs C
Java vs. C Language In this section we will compare Java and C Programming... programming language while c is procedural language Platform independence... business problem. Java is object oriented, platform independent programming language
The continue statement The continue statement is used in many programming languages such as C
The continue statement The continue statement is used in many programming languages such as C. The continue statement The continue statement is used in many programming languages such as C, C++, java etc. Sometimes we do not need
Ask C/C++ Questions online
;    C and C++ are different programming... purpose programming language that can run on most of the platforms. C is used... Bell Laboratory while C++ is a popular object oriented programming language
c#
c#  how to find out the size of the BMP image in C
C++
C++  How can i write this in dev c
C++
C++  How can i write this in dev c
c++
c++  use a prgrm as an example to xplain-: a)class b)object c)message d)cope resolution operator
c#
c#  how to find out the size of the BMP image
c++
c++  write a programme that calculates the area and circumference of a rectangle
C++
C++  dear sir How to create windows form application for login screen using C++? USER Name -TESTADMIN Password -testuser
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
 

 

 

DMCA.com