S
Sridhar_Gadda
Hello friends,
I am new to C and I have written a code but
#include <stdio.h>
main()
{
init_funtion();
}
void init_funtion();
{
int i;
for (i =1; i < 10; i++)
{
switch (i)
{
case 1 :
{
printf("my vlaue is 1");
break;
}
case 2 :
{
printf(" my value is 2");
break;
}
and so on till case 9
}
}
}
but when I complile the error is "the statement for is of no effect" is
that mean in for loop I cannot define my switch satement......in general
switch statement can be written in for loop ???
please help me ....
I am waiting for your replies
with regards,
Sridhar.
I am new to C and I have written a code but
#include <stdio.h>
main()
{
init_funtion();
}
void init_funtion();
{
int i;
for (i =1; i < 10; i++)
{
switch (i)
{
case 1 :
{
printf("my vlaue is 1");
break;
}
case 2 :
{
printf(" my value is 2");
break;
}
and so on till case 9
}
}
}
but when I complile the error is "the statement for is of no effect" is
that mean in for loop I cannot define my switch satement......in general
switch statement can be written in for loop ???
please help me ....
I am waiting for your replies
with regards,
Sridhar.