loop1:
{
x=i<n?(i++):0;
printf("%d",i);
exit(x);
continue;
}
Error- misplaced continue.
Doubt-1.will the exit(x) be executed for all values of x
2.will this statement go out of the program.


Answers were Sorted based on User's Feedback



loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplace..

Answer / vignesh1988i

1) THE exit() function will be occuring only for one value for x in this case.


the main use of exit() function is , whenever we come accross a situation that no other go when we reach certain values we must be back to the IDE again.. so for that purpose we can use exit() function...... here lies an ambiquity since u have given the exit fuction inside the looping structure.. but exit() function when it is called once it will return to the programming screen... but the loop didnt terminate yet...

2) ya sure whenever exit function is encountered this will make to come from prompt mode to the IDE mode



thank u

Is This Answer Correct ?    3 Yes 0 No

loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplace..

Answer / srinivas

Error- misplaced continue.

Is This Answer Correct ?    3 Yes 2 No

loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplace..

Answer / kar4you

Error: Misplaced Continue

Is This Answer Correct ?    1 Yes 0 No

loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplace..

Answer / vija

Dear SRIVIDYA!!!!

as per my experience....
exit() function can take only two arguments. 0(zero) and 1

exit(0)--indicates exit with error
exit(1)--indicates successful exit...

coming to yr code fragment in question..there is a
possibility for exit(x) to take other values..

so this caused the errorrrrr

-------------------------

correct me if its wrong!!


yours vijayabhaskar83@sifymail.com

Is This Answer Correct ?    0 Yes 2 No

loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplace..

Answer / padmaraj

HI,

1: the statement x=i<n?(i++):0;
the value of i is < n the i will be increamented
by 1, else 0.
2 : The value of i is printed.
3 : exit() function is executed by all values of x.
4 : this program will not go out of loop.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C C++ Errors Interview Questions

what is syntax error?

3 Answers  


how to convert decimal to hexadecimal without using arrays just loops

2 Answers  


UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....

5 Answers  


write a profram for selection sort whats the error in it?

2 Answers  


I am using Qt 5.6 during compilation it stops and gives error about Qmake The process "C:QtQt5.6.35.6.3msvc2015_64inqmake.exe" crashed. Error while building/deploying project untitled1 (kit: Desktop Qt 5.6.3 MSVC2015 64bit) When executing step "qmake"

0 Answers  






How to develop a program using C language to convert 8-bit binary values to decimals. TQ

1 Answers   Amazon,


I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX

0 Answers  


What is the out put of this programme? int a,b,c,d; printf("Enter Number!\n"); scanf("%d",&a); while(a=!0) { printf("Enter numbers/n"); scanf("%d%d%d",&b,&c,&d); a=a*b*c*d; } printf("thanks!"); getche(); Entering numbers are a=1,b=2,c=3,d=4 b=3,c=4,d=-5 b=3,c=4,d=0

5 Answers   TCS,


void main() { for(int i=0;i<5;i++); printf("%d",i); } What is the output?..

32 Answers   College School Exams Tests, CTS, HCL, iGate, SmartData,


Write a c-programe that input one number of four digits and find digits sum?

2 Answers  


loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program.

5 Answers   CMC,


I can not get my C++ program to work right. It is supposed to tell if a word is a palindrome or not, but it only tells thet the word is not a palindrome. And I can't fix it.

1 Answers  


Categories