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 |
how to print 212 as Twohundreds twelve plz provide me ans soon
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??
Write a program to swap two numbers without using third variable?
is c language is a object oreinted language?
how to count no of words,characters,lines in a paragraph.
what would be the output of the following prog? Justify your answer? main() { unsigned char ch; unsigned char i; ch = -255; printf("%d",ch); i = -1; printf("%d",i); }
write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
wat is the difference between array and pointer?
Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);
How do you generate random numbers in C?
What is the difference between fread buffer() and fwrite buffer()?