#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 use of a conditional inclusion statement in C?
What is sizeof in c?
What are pointers?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the difference between pure virtual function and virtual function?
which type of aspect you want from the student.
Is null always equal to 0(zero)?
What is atoi and atof in c?
Explain can static variables be declared in a header file?
What is the difference between union and structure in c?
How can you access memory located at a certain address?
How can you find out how much memory is available?
How is a macro different from a function?
How many bytes are occupied by near, far and huge pointers (dos)?
When should a far pointer be used?