#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 is the method to save data in stack data structure type?
How many levels of indirection in pointers can you have in a single declaration?
will u please send me the placement papers to my mail???????????????????
What are header files in c?
What are compound statements?
Why should I use standard library functions instead of writing my own?
What functions are in conio h?
What is the size of structure in c?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
How can I delete a file?
Explain what happens if you free a pointer twice?
What is graph in c?
Explain the difference between null pointer and void pointer.
What is a program?
What is a structure in c language. how to initialise a structure in c?