0% found this document useful (0 votes)
56 views

Welcome To Procoder

This document provides instructions for a weekly coding event called Procoder. It includes 5 programming questions to be solved on ideone.com, with the code links shared on a WhatsApp group or Facebook event page. Participants have 1 hour, from 10-11pm, to solve the questions. The first question tests whether a number is a power of 2 by checking if it has only one '1' bit in its binary representation. The second question prints the first x terms of the series 3n+2 that are not multiples of 4, with input x and output as specified samples. The third question swaps two numbers without a third operand or built-in functions in a single statement. The fourth calculates the square root of

Uploaded by

nvsrox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Welcome To Procoder

This document provides instructions for a weekly coding event called Procoder. It includes 5 programming questions to be solved on ideone.com, with the code links shared on a WhatsApp group or Facebook event page. Participants have 1 hour, from 10-11pm, to solve the questions. The first question tests whether a number is a power of 2 by checking if it has only one '1' bit in its binary representation. The second question prints the first x terms of the series 3n+2 that are not multiples of 4, with input x and output as specified samples. The third question swaps two numbers without a third operand or built-in functions in a single statement. The fourth calculates the square root of

Uploaded by

nvsrox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Procoder

Welcome to the First Questionnaire of our weekly event the


Procoder
Read the instructions properly.
There are total 5 programs question given to you below and all are
compulsory.

The questions will be solved on ideone.com and you will be required


to share the links of their codes on whatsapp groups or our event
page on facebook "PROCODER".

Timings are 10:00pm-11:00pm.

So All The Best all of you show your skills!!!!


Question1

TASK

Test whether a no. is power of 2 or not.

CONSTRAINTS

USE OF INBUILT FUNCTION IS PROHIBITED

You can use any programming language

INPUT FORMAT

Integer to be tested

OUTPUT FORMAT

Reply if the enterred number is power of 2 or not.

TIP-

The logic says that if a no. is power of 2, then in the binary representation, only
one bit of the no. can be 1 & rest are must be 0

For example the number 32 has a binary representation of 00100000

SAMPLES

Enter any no: 32

It is power of 2

Enter any no: 56

It is not power of 2
Question2
TASK

TERMS OF AP.

Write a program to print first x terms of series 3N+2 which are not multiples of
4.N varies from 1 to last.

INPUT FORMAT : x ,where x is of integer type.

OUTPUT FORMAT : Terms of series (separated by spaces).

SAMPLE INPUT 1

10

SAMPLE OUTPUT 1

5 11 14 17 23 26 29 35 38 41

SAMPLE INPUT 2

SAMPLE OUTPUT 2

5 11 14 17
Question3
TASK

To swap two numbers without using third operand and that too in one statement.

CONSTRAINTS

USE OF INBUILT FUNCTIONS TO ACCOMPLISH THE TASK IS PROHIBITED.

You can use any programming language.

INPUT FORMAT

Enter a number of integer type.

OUTPUT FORMAT

First line should contain both input(a,b) and second line should contain its
swapped output(b,a).

SAMPLE 1:

Input-

16 32

Output-

32 16

SAMPLE 2:

Input-

10 20

Output-

20 10
Question4
TASK

Calculate the square root of an integer.

CONSTRAINTS

USE OF INBUILT FUNCTIONS TO ACCOMPLISH THE TASK IS PROHIBITED.

You can use any programming language.

INPUT FORMAT

Enter a number of integer type.

OUTPUT FORMAT

Print the Square root of the number entered by the user of type integer.

SAMPLE 1

Input-

16

Output-

SAMPLE 2

Input-

10

Output-

33
Question5

You might also like