If I write descriptive program , will it take large size? Does C++ take large time to complie and have large file size? someone told me that IF I use C To find the prime number program then it would take low time. but if i use cin and cout then it would take long time..
What do you mean by "descriptive program"? If you mean a lot of comments, that will have no effect on the resulting object file. Comments are discarded by the compiler. Comments have no significant effect on compilation time.
If you meant something else by "descriptive program", then I don't know what you meant.
There is a general misconception that C++ produces less efficient code than C. That is generally not true. On the plattform I work on, both the C and C++ compilers use the same back end code generators and produce the same machine instructions for the same code.
It is true that cin and cout are less efficient that file I/O in C, but in most cases that difference is insignificant. In reality, how many lines of cin and cout are you doing compares to lines of calculations?
edit: One more comment on file size. Object file size is more directly impacted by the number of compilation units and libraries (not DLLs) that you bind into the object file. Most implementations use DLLs for C and C++ libraries, so these do not affect the size of your object file.
In such a program runtime speed is not an issue. The amount of time the program has to wait for the user to enter data is by far the biggest bottle neck.
Compilation speed will depend a lot on what compiler settings you have turned on. Low optimization levels often give slower runtime speed and larger file size compared to higher optimization levels. Debugging symbols can also increase the file size quite a bit but shouldn't have much impact on the runtime speed.
Yes, it might take a bit longer time to compile. It's perfectly possible. Do you care? Large programs are usually split into many files so that you only have to compile the file that has changed since last time you compiled. Some programs take hours to compile and it would be a nightmare if they had to compile the whole thing each time.
I do not recommenced squishing your lines together, compile time depends on the number of statements, not lines. Also having dense code will make your file "smaller", but harder to debug.