physics chemistry maths science forums
become expert I help I sign up I login
refer a friend - earn nickels!!   
 advanced
 
Home
Ask & Discuss Questions
Study Material
Experts Zone
Hang Out!

Ask & Discuss Questions with Community & Experts

Moderation Team
 90 chars left    advanced
Ask iit jee aieee pet cbse icse state board community Community Discussion Question: Computer Science....BOARDS.....PRACTISE...........
Forum Index -> Computer Science like the article? email it to a friend.  
Author Message
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
Hey guys out there.......I m starting this thread for all the twelthies who will be writing there CS exams on 31st.......

let us practise some questions........

heres first one.........

FIND THE OUTPUT....

#include<iostream.h>
#include<string.h>
#include<ctype.h>
void Convert(char Str[], int Len)
{
    for (int Count=0; Count<Len; Count++)
    {
        if (isupper(Str[Count]))
            Str[Count] = tolower(Str[Count]);
        else if (islower(Str[Count]))
            Str[Count] = toupper(Str[Count]);
        else if (isdigit(Str[Count]))
            Str[Count] = Str[Count] + 1;
        else Str[Count] = '*';
    }
}
void main()
{
    char Text[] = "CBSE Exam 2008";
    int Size=strlen(Text);
    Convert(Text, Size);
    cout<<Text<<endl;
    for (int C = 0, R = Size - 1; C <= Size/2; C++, R--)
    {
        char Temp = Text[C];
        Text[C] = Text[R];
        Text[R] = Temp;
    }
    cout << Text << endl;
}


My best wishes to everyone..........

BEST OF LUCK..........

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
    
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
counting five posts after this.......if no one answers it correctly then posting the correct answer......

NOTE >>>>  Pls dont run it on your PC and write the output here........it will be of no use then.......

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 2 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
nadeemoidu (1184)

Blazing goIITian

Olaaa!! Perrrfect answer. 200  [292 rates]

nadeemoidu's Avatar

total posts: 487    
offline Offline
9113*MAXe*esbc
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
noooo........four more posts remaining.......

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
nadeemoidu (1184)

Blazing goIITian

Olaaa!! Perrrfect answer. 200  [292 rates]

nadeemoidu's Avatar

total posts: 487    
offline Offline
cbse*eXAM*3119
9113*MAXe*esbc
 this reply: 5 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
great answer nadeem........this time you are absolutely correct........I hope you did it yourself....gr8.....

next one coming in 2 mins....

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
give the output...........

#include<iostream.h>
void strfn(char * *s)
{
    char *n = "INDIA";
    *s = n;
}
void main()
{
    char *str = "Bharat";
    strfn(&str);
    for (int x = 0; str[x]>0;x++)
    {
        for(int y = 0; y <= x; y++)
            cout << str[y];
        cout << endl;
    }
}


............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 5 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
sneha.bagri (142)

Blazing goIITian

Olaaa!! Perrrfect answer. 24  [35 rates]

sneha.bagri's Avatar

total posts: 378    
offline Offline
Output is:
I
IN
IND
INDI
INDIA
 this reply: 10 points  (with Olaaa!! Perrrfect answer.   in 2 votes )   [?]
 
You have to be logged on to rate
  
sneha.bagri (142)

Blazing goIITian

Olaaa!! Perrrfect answer. 24  [35 rates]

sneha.bagri's Avatar

total posts: 378    
offline Offline
Here str[x]>0 means that until it is not null. Ascii value of null is 0. so its checking whether the ascii value of character being checked is greater than 0
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
BRILLIANT SNEHA........

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2303)

Blazing goIITian

Olaaa!! Perrrfect answer. 413  [532 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
heres another one.......

#include <iostream.h>
class integer
{
    int m, n;
    public :
        integer(int, int);    // constructor declared
        void display(void)
        {
            cout << " m = " << m << "\n";
            cout << " n = " << n << "\n";
        }
};
integer::integer(int x, int y)     // constructor defined
{
    m = x;
    n = y;
}
main()
{
    integer int1(0, 100);    // implicit call
    integer int2 = integer(25, 75);    // explicit calls
    cout << "\nOBJECT1" << "\n";
    int1.display( );
    cout << "\nOBJECT2" << "\n";
    int2.display( );
}


............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
avi_1214545 (974)

Blazing goIITian

Olaaa!! Perrrfect answer. 178  [220 rates]

avi_1214545's Avatar

total posts: 318    
offline Offline
OBJECT1
m=0
n=100
OBJECT2
m=25
n=75

Na pine ka shouk tha na pilane ka shonk tha. Hume to sirf NAZREIN milane ka shonk tha. Par kya karen hum nazre hi unse mila baithe jinhe nazron se PILANE ka shonk tha.
 this reply: 5 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
spideyunlimited (3083)

Blazing goIITian

Olaaa!! Perrrfect answer. 511  [775 rates]

spideyunlimited's Avatar

total posts: 2639    
online Online
I
IN
IND
INDI
INDIA


---------------------------------------------------------------
* Gaurav Ragtah ( aka Artemis Fowl )

* Agent 'G' [sniper] - SD-6 (Alliance of Twelve)

* Your friendly neighborhood spideyunlimited
 this reply: 5 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
spideyunlimited (3083)

Blazing goIITian

Olaaa!! Perrrfect answer. 511  [775 rates]

spideyunlimited's Avatar

total posts: 2639    
online Online