#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 a lookup table in c?
What is a program flowchart?
What are different types of pointers?
How many levels deep can include files be nested?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
Can we declare a function inside a function in c?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
c program for searching a student details among 10 student details
What is the difference between memcpy and memmove?
What is the difference between printf and scanf )?
What is typedef struct in c?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
Difference between Function to pointer and pointer to function
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Difference between macros and inline functions? Can a function be forced as inline?