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 .
Answers were Sorted based on User's Feedback
Answer / swaroop
clrscr()
should be after the declaration of variables
| Is This Answer Correct ? | 14 Yes | 1 No |
Answer / 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 |
Answer / sandhiya.g
declaration should made before the clear screen statement
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / khurshid alam
sorry brother your simple mistake following this
printf("%d",a); // here semicolon(;) must be
now run your program
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain why can’t constant values be used to define an array’s initial size?
Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?
What is the output of the program #include<stdio.h> #include<conio.h> void main() {0 int i,j=20; clrscr(); for(i=1;i<3;i++) { printf("%d,",i); continue; printf("%d",j); break; } getch(); }
Explain what are compound statements?
Write a c pgm for leap year
11 Answers College School Exams Tests, IBM, TCS,
What is the difference between call by value and call by reference in c?
The file stdio.h, what does it contain?
main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail
what is the self-referential structure?
What are the concepts introduced in OOPs?
What are dynamically linked and statically linked libraries?
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.