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 / sight

You just remove the & in the last scanf statement
But also this loop will continue going on(infinite) b'coz
here no ending point.....
BTW if u remove those & it will definatly wait for entering
a charecter....

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to copy the string using switch case?

2914


What is non linear data structure in c?

1040


What do you mean by a local block?

1092


What is a #include preprocessor?

1164


Difference between macros and inline functions? Can a function be forced as inline?

1283


Differentiate between full, complete & perfect binary trees.

1120


Is there a way to jump out of a function or functions?

1112


Which is more efficient, a switch statement or an if else chain?

1039


If I have a char * variable pointing to the name of a function ..

1179


explain what are actual arguments?

1099


What is clrscr in c?

1140


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1080


Give basis knowledge of web designing ...

2024


How pointer is different from array?

1091


What is table lookup in c?

1107