| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:19:28 IST
|
|
|
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....
............................................................................................................................................................................................
|
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:21:05 IST
|
|
|
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 0 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:22:19 IST
|
|
|
9113*MAXe*esbc
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:26:21 IST
|
|
|
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 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:28:37 IST
|
|
|
cbse*eXAM*3119 9113*MAXe*esbc
|
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:31:37 IST
|
|
|
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 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 15:36:38 IST
|
|
|
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 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 16:13:26 IST
|
|
|
Output is: I IN IND INDI INDIA
|
this reply: 10 points
(with 2 
in 2 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 16:15:43 IST
|
|
|
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 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 16:36:06 IST
|
|
|
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 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 16:39:34 IST
|
|
|
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 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 16:46:13 IST
|
|
|
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 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 17:04:58 IST
|
|
|
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 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 22 Mar 2008 17:06:36 IST
|
|
|