void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?
Answer Posted / hari.11
above friend has posted correct answer,
11 is not the correct answer,
it will take all characters into buffer and will not output any answer until we press '\n' character.
So it would print 1 as many times as number of character pressed before '\n'.
e.g.:
s
o/p: 1
sd
o/p: 11
gdfdd
o/p: 11111
111
o/p: 111
for further queries and discussions, visit..
http://forum.campusmaniac.com/
http://www.campusmaniac.com/
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
Which is better between malloc and calloc?
What is an arrays?
By using C language input a date into it and if it is right?
what is the diffrenet bettwen HTTP and internet protocol
Where is c used?
What are structure types in C?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Write a factorial program using C.
What is the difference between text and binary i/o?
diff between exptected result and requirement?
What is a void pointer in c?
Is array name a pointer?
What is array of structure in c?