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

Coding Question

The document outlines a series of coding problems and their corresponding solutions in Python and Java. Each problem requires the implementation of a specific function, such as calculating the sum of two numbers, checking for palindromes, and generating Fibonacci numbers. The document serves as a guide for practicing basic programming concepts and algorithms.

Uploaded by

arjun.v.it.2021
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)
3 views

Coding Question

The document outlines a series of coding problems and their corresponding solutions in Python and Java. Each problem requires the implementation of a specific function, such as calculating the sum of two numbers, checking for palindromes, and generating Fibonacci numbers. The document serves as a guide for practicing basic programming concepts and algorithms.

Uploaded by

arjun.v.it.2021
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/ 8

Coding Question

This code is in python

1. Problem: Sum of Two Numbers

Ans. Given two integers, write a function to return their


Sum

2. Factorial of a Number

Ans. Write a function to calculate the factorial of a non-


negative integer.

3. Problem: Fibonacci Sequence


Ans . Write a function to generate the nth number in the
Fibonacci sequence

4. Problem: Palindrome Check

Ans. Write a function to check if a given string is a


palindrome.

5. Problem: Prime Number Check

Ans. Write a function to check if a given number is prime.


6. Problem: Reverse a String

Ans. Write a function to reverse a given string.

7. Problem: Count Digits in a Number

Ans. Write a function to count the number of digits in a


positive integer.

8. Problem: Find Maximum Number


Ans. Write a function to check if a given integer is even or
odd.

9. Problem: Check Even or Odd

Ans. Write a function to check if a given integer is even or


odd.

10. Problem: Calculate Power

Ans. Write a function to calculate the result of raising a


number to a given power.
This Code is in java

1. Reverse a String
Ans. Write a function to reverse a given string.

2. Check Palindrome
Ans. Write a function to check if a given string is a
palindrome.

3. Factorial of a Number
Ans. Write a function to calculate the factorial of a given
positive integer.
4. Fibonacci Sequence
Ans. Write a function to generate the nth Fibonacci
number

5. Check Prime
Ans. Write a function to check if a given positive integer is
prime.
6. Count Occurrences
Ans. Write a function to count the occurrences of a
specific element in an array

7. Check Anagram
Ans. Write a function to check if two given strings are
anagrams of each other
8. Reverse an Arra
Ans. Write a function to reverse the elements of an array
in-place.

You might also like