#include<stdio.h>
#include<conio.h>
void main()
{clrscr();
char another='y';
int num;
for(;another=='y';)
{
printf("Enter a number");
scanf("%d",&num);
printf("squre of %d is %d",num,num*num);
printf("\nwant to enter another number y/n");
scanf("%c",&another);
}
getch();
}
the above code runs only one time.on entering 'y' the
screen disappeares.what can i do?
Answer Posted / sight
You just remove the & in the last scanf statement
But also this loop will continue going on(infinite) b'coz
here no ending point.....
BTW if u remove those & it will definatly wait for entering
a charecter....
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are the benefits of c language?
Describe newline escape sequence with a sample program?
What does s c mean in text?
How can I change their mode to binary?
Are bit fields portable?
Why should I use standard library functions instead of writing my own?
How can I find out the size of a file, prior to reading it in?
How do you print an address?
What is structure of c program?
what is the significance of static storage class specifier?
What is the process to create increment and decrement stamen in c?
What is pointers in c with example?
Describe wild pointers in c?
How does sizeof know array size?
What is hungarian notation? Is it worthwhile?