#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


Please Help Members By Posting Answers For Below Questions

A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1699


What is the use of printf() and scanf() functions?

636


What is the general form of #line preprocessor?

587


explain what is an endless loop?

612


What is page thrashing?

653






C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

613


Explain the difference between the local variable and global variable in c?

605


In a switch statement, explain what will happen if a break statement is omitted?

640


what type of questions arrive in interview over c programming?

1559


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1768


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

713


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

673


Are c and c++ the same?

627


What is static memory allocation? Explain

632


What is difference between structure and union?

602