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
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 |
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 |
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 |
void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?
void main() { int i=7; printf("N= %*d",i,i); }
Using string functions write a program that will accept the name of the capital as input value and will display the corresponding country. ------------------------ Capitals Countries ------------------------ Capitals Countries Ottawa Canada Moscow Russia Rome Italy I can't not get it to run properly
what is run time error?
#include<>stdio.h> #include<>conio.h> { printf("hello"); void main() getch(); } what the out put of this program and why ......plz clear my answer
errors are known as?
3 Answers EX, State Bank Of India SBI,
Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
char* f() return "hello:"; void main() {char *str=f(); }
void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....
How to develop a program using C language to convert 8-bit binary values to decimals. TQ
WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf("%d%d%d",x,y,z); }