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

Why do we use namespace feature?

0 Answers  


Write a program to generate the Fibinocci Series

0 Answers   TISL,


program in c to print 1 to 100 without using loop

9 Answers   Wipro,


What does d mean?

0 Answers  


What is define directive?

0 Answers  






wite a programme in c to linear search a data using flag and without using flags?

3 Answers   TCS,


Ca some one please help me with aC code to allow user enter numbers from 1 to 20 without repeating and prnt the sum of those numbers thnx

4 Answers  


The operation of a stair case switch best explains the a) or operation b) and operation c)exclusive nor operation d)exclusive or operation Which of the following is/are syntactically correct? a) for(); b) for(;); c) for(,); d) for(;;);

1 Answers   HCL, Public Service Commission,


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


What is a program flowchart and explain how does it help in writing a program?

0 Answers  


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include<stdio.h>...

0 Answers  


what is the similarities between. system call and library function?

1 Answers   Wipro,


Categories