Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#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

Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2341


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1081


What is the benefit of using an enum rather than a #define constant?

1218


Is c call by value?

1002


What is scope rule in c?

1049


Is null a keyword in c?

1186


What is an auto variable in c?

1208


Explain the use of keyword 'register' with respect to variables.

1009


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1018


What is strcpy() function?

1129


What is static and auto variables in c?

1068


What is the use of linkage in c language?

1045


Explain the use of #pragma exit?

1163


What are the uses of null pointers?

1086


How do I read the arrow keys? What about function keys?

1066