I'm 13 and i just started cpp...
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<dos.h>
void main()
{
Char name[30];
Clrscr();
Cout<<"\n ENTER THE NAME ";
gets(name);
Sleep(1);
Clrscr();
Cout<<endl<<endl<<" ";
For (int i=0;name[i]!=0; i++)
{
Cout<<endl<<" "<<name[i]<<" "<<nnam[i];
Sleep(1);
}
For (int t=0; name[t]!=0; t++)
{
Cout<<" "<<name[t];
Sleep(1);
}
Getch();
}
Now in output 1st name[i] comes vertically and name[t] comes horizontally....i need space between vertical and horizontal.... How?
Please edit your post so your code is [co
de]between code tags[/code] - it will add syntax highlighting and line numbers.
There is no such header as
<iostream.h> - instead, use
<iostream>
There is no such header as
<conio.h> - don't use it
https://en.wikipedia.org/wiki/Conio.h
Although
<stdio.h> is a valid header, prefer to use
<cstdio>
There is no such header as
<dos.h> - don't use it
The return type of
main cannot be
void, it must be
int
It looks like the first character in each of your lines is capitalized - note that C++ is case-sensitive and you cannot do this.
Prefer to use
std::string instead of c-style character arrays:
http://www.cplusplus.com/reference/string/string/
http://en.cppreference.com/w/cpp/string/basic_string
Do not use
gets ever - it is deprecated because it leads to buffer overflow exploits.
Don't use
Sleep or similar to pause the program unnecessarily.
Don't use
getch or similar to pause the program:
http://www.cplusplus.com/articles/iw6AC542/
Last edited on
Soryy... I use turbo c++ so when compile.. It says something iostream not .....
And in this code i used sleep for pausing
Output
Like i wrote in the enter name.... The
It will give output.....
T (then aftrr 1 second) h (then after 1 second) e thts all
Character didn't capitalized... In program.... So i wrote this through mob thats why it is capitalized...
And the problem's solution before you answered....
But thank you...
Last edited on