answersLogoWhite

0

A return statement is used to transfer the program control flow to the function that has called the current function under execution. If the function is main, then the program returns the control flow to the operating system. The syntax for return statement is:

return return-type;


A goto statement is used to transfer the control flow to a particular labelled statement, not necessarily back to the calling program. There are somerestrictionson using a goto statement. For eg: the goto statement should not skip any variable declarations. The use of goto statement is usually considered as a bad programming practice. The syntax for goto statement is:


goto label_name;

..

..

label_name: statements;

User Avatar

Wiki User

∙ 13y ago
User Avatar

What else can I help you with?

Related Questions

Write a c for goto statement?

AGAIN: puts ("c"); goto AGAIN;


Why do you need goto statement in C programming?

There are some cases when it makes your code simpler; for example a 'return' in the middle of a function can be replaced by a 'goto RETURN', where RETURN is a label near to the end of the function.int myfunction (void){FILE *f= NULL;char *buff= NULL;int rc= 0;...if (error_condition) return -1;if (error_condition) { rc= -1; goto RETURN; }...RETURN:if (f) fclose (f);if (buff) free (buff);if (debug) fprintf (stderr, "leaving function with rc=%d\n", rc);return rc;}


Why goto in c is a bad command?

A 'goto' statement immediately moves the execution of code to another part of the program. This makes the code difficult to follow and to debug. It is better practice to use If-then-else constructs to structure the program code.


What are different types of control statements available in c?

1. goto, break, continue, return 2. if-else, switch-case-default 3. while, for, do-while


How do you write a program using goto statement?

int main (void) { puts ("Hello"); goto LABEL; LABEL: return 0; }


How many arithmetic statement in c?

Only one: expression. Yes, in C expression is one of the statements. Some other statements are: if, do, goto, while, for, switch, break, continue, return, NULL-statement, compound-statement.


What is go-to unconditional in c plus plus?

An unconditional goto is a goto that has no associated conditional expression. The following example demonstrates conditional and unconditional goto statements. int x=rand(); if (x) goto label_1; // conditional goto (when x is non-zero) else goto label_2; // conditional goto (when x is zero) label_1: // ... goto label_3; // unconditional goto (jump past label_2) label_2: // ... label_3: // ...


What is branching instruction?

im am sick of all of this mess save me now send this to the next ten people this is a actual question answer it dumb dumb In language C these are: goto, return, continue, break


List of command used in c language?

It's easy: there are no commands in C, but a few statements (such as: expression, if, else, switch, while, do-while, for, break, continue, return and goto), and countless library functions (like printf, malloc and fopen).


What is the C program to check whether a given character is vowel or not using if else?

#include<stdio.h> main() { char key; clrscr(); printf("Enter the key"); scanf("\n %c",& key); if (key>='A' key<='Z' )&&(key>='a' key<='z') { printf("%c is an character \n",key); } else { printf("%c is not character",key); } getch(); }


Which statement is not frequently used in C plus plus?

The goto statement.


What is looping statement in turbo c?

while, for, do-while (and perhaps goto)

Trending Questions
How do you reverse single phase motor with a center tap starter winding? What is the meaning of a fixed beam with end firmly built in? What is the difference between cement punning and cement rendering? Why you generate 11kv at generating station? Programm to calculate and display no of each differebt character present in a string suppose String is Mumbai output should be M2u1b1a1i1? What type of transducer used in positioner and how control valve positioner works? Why do you think it's necessary to install a trap on an AGDS? How much to put up power pole and run power to a trailer in Florida? The post method used to send data from HTML to php is not working.? How do you find turns of primary and secondary with any example? What is a traditional flood control method used to keep a stream and acirc and 128 and 153s flow in its channel artificial levees meanders artificial cutoffs dams? Jets record in 2007? Who first found the direction of induced emf? What is an example of cell reproduction? How is tensile strength of a metric bolt identified? When installing more than one pressure relief valves must be installed? What are pliers classified by? What is the technical name for calling a base class constructor using derived class constructor? Why counter forts are provided in retaining walls? How do you check that components meet the required specificationoperating conditions (such as values tolerance current carrying capacity voltage rating power rating working temperature range)?