Topic Wise Solved Problems Question – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
CPP All :Topicwise Exam Questions: user-defined-data-types siteicon
01D-2017 2

Find and write the output of the following C++ program code:
Note: Assume all required header files are already included in the program.

typedef char STRING[80];
void MIXITNOW(STRING S)
{
  int Size=strlen(S);
  for (int I=0;I<Size-1;I+=2)
  {
    char WS=S[I];
    S[I]=S[I+1];
    S[I+1]=WS;
  }
  for (I=1;I<Size;I+=2)
    if (S[I]>='M' && S[I]<='U')
      S[I]=’@’;
}
void main()
{
  STRING Word="CRACKAJACK";
  MIXITNOW(Word);
  cout<<Word<<endl;
}

 

CBSE12D-2016

Error finding, typedef and others 2

Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined.
Note : Assume all required header files are already included in the program.

 

Typedef Count int;
void main()
{
  Count C;
  cout<<"Enter the count:";
  cin>>C;
  for (K = 1; K<=C; K++)
    cout<< C "*" K <<endl;
}
CBSE12A-2018

01D 2

Find and write the output of the following C++ program code:
Note: Assume all required header files are already included in the program.

typedef char TEXT[80];
void JumbleUp(TEXT T)
{
  int L=strlen(T);
  for (int C=0;C<L1;C+=2)
{
  char CT=T[C];
  T[C]=T[C+1]
  T[C+1]=CT;
}
  for (C=1;C<L;C+=2)
  if (T[C]>='M' && T[C]<='U')
  T[C]=’@’;
}
void main()
{
  TEXT Str="HARMONIOUS";
  JumbleUp(Str);
  cout<<Str<<endl;
}
CBSE12A-2016