65 859
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #23916 in C++ for Tom Jose

Question #23916
what will be the output of the following program:
#include<iostream.h>
#include<ctype.h>
typedef char str[80];
void main()
{
char *notes;
str[80]="vR.2GooD";
int l=6;
notes=str;
while(l>3)
{str[l]=(isupper(str[l])?tolower(str[l]):toupper(str[l]));toupper(str[l]);
cout<<notes<<endl;
l--;
notes++;
}
}
The text says that the output is
VR2Good
R2Good
good how will i get that output?

thanks in advance........................
Expert's answer
#include <iostream>
#include <conio.h>
#include <ctype.h>

using namespace std;

char str[80] = "vR2GooD";

void main()
{
char* notes = str;
int l = 6;

while (l > 3)
{
str[l] = tolower(str[l]);
cout << notes << endl;
l--;
notes++;
}
_getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions