writing a simple programming for counting

Discussion in 'C++' started by aliz_khanz, Mar 31, 2011.

  1. aliz_khanz

    aliz_khanz New Member

    Joined:
    Mar 31, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. unni krishnan.r

    unni krishnan.r Member

    Joined:
    Apr 20, 2010
    Messages:
    206
    Likes Received:
    3
    Trophy Points:
    18
    Occupation:
    education
    Location:
    Kerala
    Home Page:
    http://blogofunni.blogspot.com
    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];
    }
    }
    
    
    
     
  3. aliz_khanz

    aliz_khanz New Member

    Joined:
    Mar 31, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    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 !!!
     
  4. aliz_khanz

    aliz_khanz New Member

    Joined:
    Mar 31, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    I have tried the programme and it the built is failed :(
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice