TCS
Company
Programming
Program
Identify the line number in which the error exists?
# include
# include
void main()
{
float a = 100.00;
{
auto float a = 250.14;
{
auto float b = 325;
printf(“n%f %f”, a, b);
b++;
}
a++;
printf(“n%f %f”, a, b);
a++;
}
printf(“n%f”, a);
}
A)line number 5 B)line number 7 C)line number 9 D)line number 14
Read Solution (Total 2)
-
- D) line number 14
'b' undeclared (first use in this function) - 3 years agoHelpfull: Yes(1) No(0)
- C) line number 9
The variable ‘b’ is declared in the inner block and is accessed in the outer block. Declare ‘b’ globally to remove the error. - 3 years agoHelpfull: Yes(0) No(0)
TCS Other Question