when i declare as:
void main()
{
clrscr();
int a=10;
printf("%d",a)
}
my problem that why generate a error in above programs.
please tell me answer seriously .
Answer Posted / pushpendra chauhan
the clear screen function clrscr() is not allowed before declaration of the variables in c....but if you will save your
program with .cpp extension then it will work ....bcoz it is allowed in c++.and you also dint put semicolon ; after printf statement...
Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Why malloc is faster than calloc?
Can 'this' pointer by used in the constructor?
How can I swap two values without using a temporary?
What are loops c?
What are the 4 types of functions?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What are operators in c?
How many levels deep can include files be nested?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
Explain the use of #pragma exit?
What do you mean by recursion in c?
Function calling procedures? and their differences? Why should one go for Call by Reference?
to find the closest pair
What is the difference between c &c++?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software