Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   writing a simple programming for counting (http://www.go4expert.com/forums/writing-simple-programming-counting-t25387/)

aliz_khanz 1Apr2011 04:10

writing a simple programming for counting
 
I have to write a program which prints the input lines which will skip the initial spaces and tabulator characters, as well as completely empty lines.

unni krishnan.r 1Apr2011 09:04

Re: writing a simple programming for counting
 
I didnt understant the question
one thing aliz_khanz,
in your program if you input "i hate $ Love stories"
it will output "ihatelovestories"
thats all i understant and ive done a programm 4 u
Code:

#include<iostream.h>
#include<conio.h>
void main()
{
int size;
char a[100];
cout<<"enter the size of string";
cin>>size;
cout<<"enter the sring"
cin.getline(a,size);
for(int i=0;a[i]!='\0';i++)
{
        if(a[i]>='a' && a[i]<='z')
        cout<<a[i];
        if(a[i]>='A' && a[i]<='Z')
        cout<<a[i];
}
}


aliz_khanz 1Apr2011 09:20

Re: writing a simple programming for counting
 
Hey thanks man ! .....

actually what i understand is .......lets say you write i hate love stories and in the next line you write ranbir kapoor , the programme should show it in one line. i hope it helps !!!

aliz_khanz 1Apr2011 09:26

Re: writing a simple programming for counting
 
I have tried the programme and it the built is failed :(


All times are GMT +5.5. The time now is 21:57.