Jump to content

programming question -- solve this


Recommended Posts

Posted
  • Six chairs are arranged along a circle. Starting clockwise remove the chair - at count 4 (4th chair in this case). Continue the same process with the fresh count starting from the 5th chair, remove the next chair at count 4, and so on until there is only 1 chair left. Write a function to achieve the result.
  • write a program to PRINTXO(int n)
    • ex: if n= 4

PRINT Below:

xo
ooxx
xxxooo
ooooxxxx

PRINT Below

   xo
  ooxx
 xxxooo
ooooxxxx

Posted
5 minutes ago, Samara said:

print('xo\n');
print('ooxx\n');
print('xxxooo\n');
print('ooooxxxx);

Samara

This is now called out of box thinking @3$%

100/100 

  • Haha 1
Posted
4 minutes ago, Amrita said:

This is now called out of box thinking @3$%

100/100 

enduku spam seyyadam TS vachi tidatadu Trivikram.gif

Posted
Just now, Samara said:

enduku spam seyyadam TS vachi tidatadu Trivikram.gif

Nenaite interview lo ela evaranna chepte/raste i will def select them. @3$%

  • Haha 1
Posted
19 minutes ago, vaakel_saab said:
  • Six chairs are arranged along a circle. Starting clockwise remove the chair - at count 4 (4th chair in this case). Continue the same process with the fresh count starting from the 5th chair, remove the next chair at count 4, and so on until there is only 1 chair left. Write a function to achieve the result.
  • write a program to PRINTXO(int n)
    • ex: if n= 4

PRINT Below:

xo
ooxx
xxxooo
ooooxxxx

PRINT Below

   xo
  ooxx
 xxxooo
ooooxxxx

using System;
class HelloWorld {
  static void Main() {
     
    int n=4;
    for(int i=1;i<=n;i++) {
        
        
        for(int j=1;j<=i;j++) {
            Console.Write(i%2==0?"X":"O");
        }
        
        for(int k=1;k<=i;k++) {
            Console.Write(i%2==0?"O":"X");
        }
        
        Console.WriteLine(" ");
    }
  }
}

this is for first question

 

https://onlinegdb.com/zLYQ1wDZX

  • Like 1
Posted
5 minutes ago, Amrita said:

Nenaite interview lo ela evaranna chepte/raste i will def select them. @3$%

eppudu chudaleda adi? Btech computer lab lo output alage chupinche vallu 🤣

Posted
23 minutes ago, vaakel_saab said:
  • Six chairs are arranged along a circle. Starting clockwise remove the chair - at count 4 (4th chair in this case). Continue the same process with the fresh count starting from the 5th chair, remove the next chair at count 4, and so on until there is only 1 chair left. Write a function to achieve the result.
  • write a program to PRINTXO(int n)
    • ex: if n= 4

PRINT Below:

xo
ooxx
xxxooo
ooooxxxx

PRINT Below

   xo
  ooxx
 xxxooo
ooooxxxx

this is for second question....

 

using System;
class HelloWorld {
  static void Main() {
     
    int n=4;
    for(int i=1;i<=n;i++) {
        
        for(int m=n;m>=i;m--) {
            Console.Write(" ");
        }
        for(int j=1;j<=i;j++) {
            Console.Write(i%2==0?"X":"O");
        }
        
        for(int k=1;k<=i;k++) {
            Console.Write(i%2==0?"O":"X");
        }
        
        Console.WriteLine(" ");
    }
  }
}

https://onlinegdb.com/DfLt1nEfhi

  • Like 1
Posted
1 minute ago, JAMBALHOT_RAJA said:

eppudu chudaleda adi? Btech computer lab lo output alage chupinche vallu 🤣

Nope i never did.  I missed all the fun then $s@d

Posted
9 minutes ago, dasari4kntr said:

using System;
class HelloWorld {
  static void Main() {
     
    int n=4;
    for(int i=1;i<=n;i++) {
        
        
        for(int j=1;j<=i;j++) {
            Console.Write(i%2==0?"X":"O");
        }
        
        for(int k=1;k<=i;k++) {
            Console.Write(i%2==0?"O":"X");
        }
        
        Console.WriteLine(" ");
    }
  }
}

this is for first question

Thanks ba

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...