#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 are reserved words with a programming language?
Explain how do you override a defined macro?
What is auto keyword in c?
Is c# a good language?
Can true be a variable name in c?
How many identifiers are there in c?
difference between object file and executable file
Why can arithmetic operations not be performed on void pointers?
What are variables c?
What are the differences between new and malloc in C?
Difference between constant pointer and pointer to a constant.
How many levels deep can include files be nested?
Which are low level languages?
in iso what are the common technological language?
When should structures be passed by values or by references?