Status
Not open for further replies.

DigitalLover

Active Member
76
2010
0
0
I am learning c++ in my college. they we use turbo c++ for compiling but turbo c++ doesn't works on my computer because of winodws 7.

i tried to compile this program in visual c++ 2005 express edition but i failed. Please help me out...

#include <iostream.h>
#include <conio.h>
void main()
{
int n,i;
float a[100];
cout<<"How Many Elements You Want To Input";
cin>>n;
cout<<"\nEnter The elements of array\n";
for (i=0; i<=n; i++)
{
cin>>a;
}
cout<<"\nThe Array Given by you is\n";
for (i=o; i<n; i++)
{
cout<<a;
}
getch();
}
 
5 comments
Have you Installed VC++ in the Default Directory ?
If yes then follow the below steps

Copy the Program to to C:\Program Files\Microsoft Visual Studio "w/e version u are using"\VC

Open the Visual Studio Command Prompt from start Menu

Type "cl <name of file with extension>" without the Quotes
e.g. If I have a C++ file with the name helloWorld.cc
Type "cl HelloWorld.cc" without the Quotes
You will get an executable file with the same name in the Folder. Just run it.


PS : Since you are trying out such Simple Programs. Just use
Code:
http://codepad.org/

.
.
.
 
Code:
#include <iostream.h>
#include <conio.h>
void main()
{ 
    int n,i;
    float a[100];
    cout<<"How Many Elements You Want To Input";
    cin>>n;
    cout<<"\nEnter The elements of array\n";
    for (i=0; i<n; i++)
    {
        cin>>a[i];
    }
    cout<<"\nThe Array Given by you is\n";
    for (i=0; i<n; i++)
    {
        cout<<a[i];
    }
getch();
}

This should work for you, Turbo C++ works in Win 7 32 bit. You can also try for codeblocks.
 
Status
Not open for further replies.
Back
Top