Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



when i declare as: void main() { clrscr(); int a=10; printf("%d",a) } my problem t..

Answer / swaroop

clrscr()
should be after the declaration of variables

Is This Answer Correct ?    14 Yes 1 No

when i declare as: void main() { clrscr(); int a=10; printf("%d",a) } my problem t..

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

when i declare as: void main() { clrscr(); int a=10; printf("%d",a) } my problem t..

Answer / sandhiya.g

declaration should made before the clear screen statement

Is This Answer Correct ?    6 Yes 2 No

when i declare as: void main() { clrscr(); int a=10; printf("%d",a) } my problem t..

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

Post New Answer

More C Interview Questions

how to print 212 as Twohundreds twelve plz provide me ans soon

1 Answers  


struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??

9 Answers   Verifone,


Write a program to swap two numbers without using third variable?

0 Answers  


is c language is a object oreinted language?

5 Answers   TCS,


how to count no of words,characters,lines in a paragraph.

0 Answers  


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); }

1 Answers  


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); }

1 Answers  


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

0 Answers  


wat is the difference between array and pointer?

4 Answers   Wipro,


Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);

5 Answers  


How do you generate random numbers in C?

0 Answers  


What is the difference between fread buffer() and fwrite buffer()?

0 Answers  


Categories