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
What are the 5 data types?
How can a process change an environment variable in its caller?
What is union in c?
write a program to find the given number is prime or not
What is the modulus operator?
What is the use of f in c?
Difference between malloc() and calloc() function?
What does c mean before a date?
Explain what is a program flowchart and explain how does it help in writing a program?
What is the purpose of 'register' keyword in c language?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
How can I make it pause before closing the program output window?
Tell us something about keyword 'auto'.
Why is void main used?
How many keywords (reserve words) are in c?