#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 / jyoti goyal
Just replace %c by %s in the last scanf.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the code in while loop that returns the output of given code?
How to Throw some light on the splay trees?
Ow can I insert or delete a line (or record) in the middle of a file?
What is this infamous null pointer, anyway?
Explain what is wrong in this statement?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What is volatile variable in c?
write a proram to reverse the string using switch case?
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
What is the use of bitwise operator?
Where can I get an ansi-compatible lint?
What is a void pointer? When is a void pointer used?
if p is a string contained in a string?
How to find a missed value, if you want to store 100 values in a 99 sized array?
How do you use a pointer to a function?