C questions with answer

Variable naming rule in c programming language:
(q) What will be output of the following program?
void main()
{
char * emp name=”raja”;
printf("%s",emp name);
getch();
}
Output: Compilation error
Explanation:
Error: Invalid variable name. Except underscore there should not be any special character in name of variable event blank space.
(q) What will be output of the following program?
void main()
{
long int new=5l;
printf("%ld",new);
getch();
}
Output: 5
Explanation:
We can use c++ keyword in variable name in c programming. (But should not use, why?)

1 comment:

suresh said...
This comment has been removed by the author.