Question:
Can we make any program in c++ without using any header file and what is the shortest program in c++.
Answer:
Program will not execute without header file.<br>shortest program in c++ is to print "hello world" Source: CoolInterview.com
Answered by: ankita | Date: 8/11/2008
| Contact ankita
Program will not execute without header file.<br>shortest program in c++ is to print "hello world" Source: CoolInterview.com
Answered by: suresh singh | Date: 8/12/2008
| Contact suresh singh
Only main u can declare without using header file<br><br>void main()<br>{} Source: CoolInterview.com
Answered by: Praveen | Date: 8/12/2008
| Contact Praveen
Yes,we can a program that will not have the header file.<br>main()<br>{<br>} Source: CoolInterview.com
Answered by: Tapan | Date: 8/13/2008
| Contact Tapan
C++ program can't be run without header file but a c program can execute without a header file. shortest c++ program is #include<iostream.h>int main(){return 0;} Source: CoolInterview.com
Answered by: sucharita | Date: 8/20/2008
| Contact sucharita
No programme can run wdout headerfile. <br>shortest prog. is<br>#<br>#<br>void main()<br>{<br>cout<<"i";<br>} Source: CoolInterview.com
Answered by: Gaurav Samantaray | Date: 8/22/2008
| Contact Gaurav Samantaray
Yes, we can make a program without using any header file. <br>The shortest program in C++ is: <br>int main()<br>{<br> return 0;<br>}<br> Source: CoolInterview.com
Answered by: David Cauz | Date: 2/25/2009
| Contact David Cauz
shortest program that excute is<br>main(){}<br>this program executed not disply in dos b'coz we are not using getch();<br>function to showing output screen. Source: CoolInterview.com
Answered by: ashok | Date: 4/8/2009
| Contact ashok
int main()<br>{<br>return 0;<br>}<br>(OR)<br>int main()<br>{<br>int a;<br>a=50;<br>return 0;<br>} Source: CoolInterview.com
Answered by: VenkatGopu | Date: 5/28/2009
| Contact VenkatGopu
Yes we can. Shortest prog can be :<br>int main()<br>{<br>return 0;<br>} Source: CoolInterview.com
Answered by: Neelam | Date: 6/30/2009
| Contact Neelam
shortest program is:<br>void main(){} Source: CoolInterview.com
Answered by: kamal | Date: 7/1/2009
| Contact kamal
Following works both in C and C++.<br><br>int main()<br>{<br> return 0;<br>}<br> Source: CoolInterview.com
Answered by: Gajanan Rudrawar | Date: 10/10/2009
| Contact Gajanan Rudrawar
Yes you we can write a C++ program without including header files. The header file is only needed when you want to include the functionality defined in that file. Source: CoolInterview.com
Answered by: Subhash Reddy Mandadi | Date: 7/5/2010
| Contact Subhash Reddy Mandadi
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|