what is meant for variable not found?
Answers were Sorted based on User's Feedback
Answer / vivek
Its a very simple answer if u r thinking as a software
engineer . so these mimi things are very importants .
variable not found means . in this program
U HAVE NOT DECLARED THE VARIABLE CALLED iSum . AND U R
TRYING TO ASSIGN THE i + j TO iSum VARIABLE WHICH WAS NOT
DECLARED THATS Y THE COMPILER GIVING AN ERROR .
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / yogambika
when u have not declared variable in the main function or
any other function but used in the program.
example:
main()
{
int i,j;----------------> (iSum not declared)
printf("enter the value of i and j");
scanf("%d%d",&i,&j);
iSum = i + j;
printf("The Sum =",iSum);
getch();
}
In this case iSum will Show a compiler error "Variable not
found".
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / deepti khanna
in some of the programming language it is not required to
declare a variable before we use, but in c++ while using a
variable prior to that we need to declare the variable
first.
main()
{
i=25;
cout<<i;
}
above program may show error because we doesn't declare a
variable.
Is This Answer Correct ? | 0 Yes | 0 No |
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 .
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a do...while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total . Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total . Use no variables other than n , k , and total .
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.
class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }
main() { char c; for(c='A';c<='Z';c++) getch(); }
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
how to convert decimal to binary in c using while loop without using array
50 Answers Apple, Aptech, Arwen Tech, BCS, C2D Software, CEC,
What is probability to guarantee that the task a programmer is going to create will be created and be able to run on a particular system (RTOS/GPOS).
what is exceptions?
Assume that the int variables i and j have been declared, and that n has been declared and initialized. Write code that causes a "triangle" of asterisks of size n to be output to the screen. Specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consistings of three, etc. The last line should consist of n asterisks. Thus, for example, if n has value 3, the output of your code should be * ** *** You should not output any space characters. Hint: Use a for loop nested inside another for loop.
which typw of errors ? & how to solve it ?
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.....