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


Please Help Members By Posting Answers For Below Questions

Define recursion in c.

693


What is the use of pragma in embedded c?

583


Function calling procedures? and their differences? Why should one go for Call by Reference?

623


What is the explanation for the dangling pointer in c?

666


What is the use of function in c?

702






Which is the memory area not included in C program? give the reason

1495


If you know then define #pragma?

668


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1716


Explain what is gets() function?

616


formula to convert 2500mmh2o into m3/hr

487


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

1904


How can I write a function that takes a format string and a variable number of arguments?

598


What do you mean by Recursion Function?

623


What are Macros? What are its advantages and disadvantages?

631


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1580