Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Design-concepts-design-patterns goto statement problem. reply fast.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Nikul
goto statement problem. reply fast.
4 Answer(s)      3 years and 11 months ago
Posted in : Design concepts & design patterns


I have done some operation, and want to repeat same operation again at users choice. but its not working properly. I am using goto statement.

void main()

{ float rs, p;

    char z;

clrscr();

    rep :

    printf("\nEnter the value rs");

    scanf("%f",&rs);

    p=rs*100;

    printf("\n\npaisa =%2.f ",p);

    printf("\n do you want to access operation once again? press y/n");

    if(z='y') /* i have check this also by if(z=='y') but its not working. */
        goto  rep;
getch();

}

problem happening is either its repeating again and again.. or its not repeating according to users choice.


Advertisement
View Answers

February 5, 2011 at 9:58 AM


try this...

void main()
{
    float rs,p;
    char z='y';
    clrscr();
  while(z=='y')
   {
    printf("\nEnter the value rs");
    scanf("%f",&rs);
    p=rs*100;
    printf("\n\npaisa =%2.f ",p);
    printf("\n do you want to access operation once again? press y/n");
    scanf("%c",z); 
    }
getch();
}


February 5, 2011 at 10:04 AM


try this...

void main()
{
    float rs,p;
    char z='y';
    clrscr();
  while(z=='y')
   {
    printf("\nEnter the value rs");
    scanf("%f",&rs);
    p=rs*100;
    printf("\n\npaisa =%2.f ",p);
    printf("\n do you want to access operation once again? press y/n");
    scanf("%c",z); 
    }
getch();
}


February 5, 2011 at 10:18 AM


void main()
{
    float rs,p;
    char z;
    clrscr();
rep : ;
    printf("\nEnter the value rs");
    scanf("%f",&rs);
    p=rs*100;
    printf("\n\npaisa =%2.f ",p);
    printf("\n do you want to access operation once again? press y/n");
    if(z=='y') /* i have check this also by if(z=='y') but its not working. */
        goto  rep;
getch();


February 5, 2011 at 1:11 PM


Have a look at the following tutorial:

C goto statement



Related Tutorials/Questions & Answers:
goto statement problem. reply fast.
goto statement problem. reply fast.  I have done some operation... properly. I am using goto statement. void main() { float rs, p; char z...();   Have a look at the following tutorial: C goto statement
GOTO Statement in java
GOTO Statement in java  I have tried many time to use java goto statement but it never works i search from youtube google but e the example on net are also give compile error. if possible please give me some code with example
Advertisements
C Goto Statement
C Goto Statement       This section explains you the concept of 'goto' statement in C.  The goto statement is a jump statement which jumps from one point to another point
fast Reply - Java Beginners
fast Reply  Hi Friend I want to passing value one page to another page without using session varible....please help me write the code and send me   Hi friend, For solving the problem visit to : http
Thanks for fast reply - Java Beginners
Thanks for fast reply  Thanks for response I am already use html for data grid but i m noot understood how to connect to the data base, and how...); con = DriverManager.getConnection(url+db, user, pass); Statement st
PHP Goto
Goto Statement: The goto operator is used to jump to another line or section... inside a loop/switch structure using goto statement. You may jump out of these constructs using goto statement. Example: <?php echo "First
please reply fast if anyone knows that how to install mysql on windows using msi package
please reply fast if anyone knows that how to install mysql on windows using msi package  please reply fast if anyone knows that how to install mysql on windows using msi package   Hello Friend, visit here Thanks
Substitute Of goto
Substitute Of goto  What is substitute of goto(as it can be used in C++) in java? My Code is: for(int Index = 0 ; Index < 100 ; Index... modifiedValue goto Start
Java IF statement problem
Java IF statement problem  Dear Sir/Madam i am using the following code. expected to not have any output but it still showing "welcome".. please help me why it showing "welcome". class c1 { int a=5; while(a>1
Problem Statement : Show Booking System
Problem Statement : Show Booking System  Yashwant Rao Chavan Auditorium has few stage shows running currently. Initialize the Show data by de-serializing a serialized file provided in the Participant_Workspace of the project
Problem Statement : Show Booking System
Problem Statement : Show Booking System  Yashwant Rao Chavan Auditorium has few stage shows running currently. Now that we have the details of the shows that are currently running, we will book our tickets using following method
struts problem ... need help urgently.. please reply ASAP
struts problem ... need help urgently.. please reply ASAP  Hi Every1, I want to make an application using struts 1.2. I am a beginner on struts... depends on server or IDE. Please reply ASAP. Thanx , am2085
fast view web--yes - Struts
fast view web--yes  How to enable the fast web view--yes on pdf file  Hi Friend, Please clarify your problem. Thanks
for statement
for statement  for(int i=0;i<5;i++); { system.out.println("The value of i is :"+i); } if i end for statement what will be the output   got the answer.. it displays only the last iteration that is "The value of i
reply to the mail
reply to the mail  Hi! which jar file needed to be added? Thanks   Question not clear
reply must
reply must  is it critical to do a software job based on games(java) i know core java & advanced java basics only please give me answer
Reply me - Java Beginners
Reply me  Hi,   Hi Ragini please specify main problem. where are problem in your code. Thanks
fast food restaurant
fast food restaurant  I need to design a Java application to manage a drive-thru restaurant. There are two drive-thru windows to serve customers and a kitchen to prepare the ordered food. Use an random number generator
Reply Me - Java Beginners
Reply Me  Hi Amardeep I am sending database table name,code... "code too large for try statement" please help me its very urgent......   Hi Ragini, I can understand your problem. Today once again try
Reply Me - Java Beginners
=13c222b87273340cf002bfba4ab9d045. please reply me fast its urgent...Reply Me  Hi All, I want to using query string in my page please write the query string in java script and send me and I have a some link
Reply - Struts
("txtICNAMEOFOCCP" + W); } } Here i got problem...when i debug the code... debug... if you understtod my problem then write the code and send me...its very
Plz chk it and reply again - Java Beginners
Plz chk it and reply again  Hi Deepak, Thanks for fast reply,your application is good,u write this code for user click the view database... fast reply.  Hi Ragini, Please specify your requirements
Reply - JSP-Servlet
... Thanks for your fast reply.. Thanks/Regards, R.Ragavendran..  
Reply me - Java Beginners
Reply me  If u r not understood my just posted question plz let me know  Hi Ragini, Please specify your requirements in detail. It would be good for me to provide you the solution if problem is clear. And also
Reply Me - Java Beginners
Reply Me  Hi, Please Help Me using jsp technologies I have... understood my problem then please send me.....  Hi friend, Please specify the problem in details and give full code having the problem. Thanks
Reply me - Java Beginners
Reply me   Hi, I am using this code for session but i am calling admin_home1.jsp then page is going on the admin_home1.jsp but this data... specifies the page name to show the data for solving the problem. For read
Reply Me - Java Beginners
Reply Me  Hi, This is not correct url please send me again coorect url
Reply Me - Java Beginners
Reply Me   Hi I am sending some code please check it and solve this code is only insert into the data base please insert data in the database table and reply me fast...I got two error 1 is catch is without try 2 is try
Reply Me - Java Beginners
Reply Me  Hi, Details structure Using jsp code I m sending table structure and again sending our problem Steps:- 1:-If user input in name text box like a,then display record related to a not b and c(means
Reply me - Java Beginners
Reply me  Hi, this code is .java file but i am working in jsp tchnologies and i wantr this if user input a in text box the table have... con=null; Statement stmt = con.createStatement(); ResultSet
 

 

 

DMCA.com