#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
Explain the Difference between the New and Malloc keyword.
What is the difference between Printf(..) and sprint(...) ?
What is scope of variable in c?
Explain what does the function toupper() do?
Are there namespaces in c?
How will you divide two numbers in a MACRO?
number of times a digit is present in a number
How do you view the path?
What is the difference between procedural and functional programming?
What functions are in conio h?
What are keywords c?
What does the error 'Null Pointer Assignment' mean and what causes this error?
Why does notstrcat(string, "!");Work?
Is this program statement valid? INT = 10.50;
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above