#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 does c value mean?
Differentiate between static and dynamic modeling.
What are compound statements?
Explain how can you tell whether two strings are the same?
What is wrong with this program statement? void = 10;
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
Why is void main used?
What is extern storage class in c?
What is the equivalent code of the following statement in WHILE LOOP format?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is #ifdef ? What is its application?
Is return a keyword in c?
What is function prototype?
What are actual arguments?
What is the difference between NULL and NUL?