what is meant for variable not found?

Answers were Sorted based on User's Feedback



what is meant for variable not found?..

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

what is meant for variable not found?..

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

what is meant for variable not found?..

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

Post New Answer

More C C++ Errors Interview Questions

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 .

2 Answers  


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 .

3 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,


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(); } }

1 Answers  


main() { char c; for(c='A';c<='Z';c++) getch(); }

9 Answers  






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

5 Answers  


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).

0 Answers  


what is exceptions?

5 Answers   HCL, Wipro,


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.

2 Answers   HCL,


which typw of errors ? & how to solve it ?

0 Answers  


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.....

2 Answers  


Categories