logo image

Basic Computer Science programs

Views: 118

Basics

  1. Print Hello World! Java | C Language | C++ | Python | C# | Go | JavaScript | Kotlin | Ruby
  2. Print a multiline Hello World! Java | C Language | C++ | Python | C# | Go | JavaScript | Kotlin | Ruby
  3. Scan name of user and say hello with name Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  4. Take age and tell whether its infant or child or adult Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  5. Take a character and tell its vowel or consonant Java | C Language | C++ | Python | C# | Go | JavaScript
  6. Print numbers from 1 to 10 using for loop Java | C Language | C++ | Python | C# | Go | JavaScript
  7. Print numbers from 1 to 10 using while loop Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  8. Take birth year and tell age Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  9. Take a number between 0 to 9 and print the word representation for that number Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  10. Take a max limit from user and generate a random number till that number Java | C Language | C++ | Go | JavaScript
  11. Generate random string Java | JavaScript
  12. Show current time in milliseconds Java
  13. Show current day Java
  14. Print present year java
  15. Print present month Java
  16. Print present date Java
  17. Show current time in seconds Java

Basic Math

  1. Take two numbers from user and add those two numbers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  2. Find largest number from given 2 numbers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  3. Find largest number from given 3 numbers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  4. Print table for given number Java | C Language | C++ | Python | C# | Go | JavaScript
  5. Take a year as input and tell whether it's a leap year or not Java | C Language | C++ | C# | Go | JavaScript
  6. Multiply given two numbers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  7. Take a number as input and tell its positive or negative Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  8. Take a number as input and calculate the square of that number Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  9. Take a number as input and calculate the square root of given number Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  10. Take a number as input and tell its even or odd number Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  11. Take a number as input and tell its a Prime number or not
  12. Average of given 3 numbers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  13. Average of given n Numbers
  14. Print tables from 1 to 20 Java | C Language | C++ | C# | Go | JavaScript
  15. Calculate interest Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  16. Print fibonacci series
  17. Sum of n natural numbers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  18. Factorial of given number Java | C Language | C++ | Python | C# | Go | JavaScript
  19. Calculate discount Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  20. Calculate salary hike Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby

Math - geometry

  1. How to calculate triangle area Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  2. How to calculate triangle circumference Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  3. How to calculate rectangle area and circumference Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  4. How to calculate trapezoid area Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  5. How to calculate trapezoid circumference Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  6. How to calculate parallelogram area Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  7. How to calculate parallelogram circumference Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  8. How to calculate circle area Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  9. How to calculate circle circumference Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  10. How to calculate square area and circumference Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby

Note: (Refer https://www.science.co.il/formula/ )

Math - Unit conversions

  1. Fahrenheit to celsius Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  2. centimeters to millimeters Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  3. millimeters to centimeters Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  4. feet to inches Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  5. inches to feet Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  6. kilometers to miles Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  7. miles to kilometers Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  8. grams to kilograms Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  9. kilograms to grams Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  10. days to hours Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  11. hours to seconds Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  12. hours to milliseconds Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  13. days to seconds Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  14. hours to minutes Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  15. days to milliseconds Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  16. dollars to rupees Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby
  17. rupees to dollars Java | C Language | C++ | Python | C# | Go | JavaScript | Ruby

String operations

  1. Find length of a string Java | C Language | C# | Go | JavaScript | Ruby
  2. Convert given string to lower case Java | C# | Go | JavaScript | Ruby
  3. Join two given strings Java | C Language | C# | Go | JavaScript | Ruby
  4. Replace spaces with hyphen in a string Java | C# | Go | JavaScript | Ruby
  5. Find the occurrences of a character in a String
  6. Compare two strings are equal or not Java | C# | Go | JavaScript | Ruby
  7. Compare two strings are equal by ignoring the case Java | C# | Go | JavaScript | Ruby
  8. Print character at given index in a given string Java | C# | Go
  9. Find the index of a particular character in a given string Java | C# | Go | JavaScript
  10. Print given string in reverse order Java | C# | JavaScript
  11. Convert given string to upper case Java | C# | Go | JavaScript | Ruby

Shapes

  1. Print Pyramid with stars
  2. Print Pyramid with numbers
  3. Print Pyramid with alphabets
  4. Print Reverse Pyramid with stars
  5. Print Reverse Pyramid with numbers
  6. Print Reverse Pyramid with alphabets
  7. Print hollow Pyramid with stars
  8. Print hollow Pyramid with numbers
  9. Print hollow Pyramid with alphabets
  10. Print Reverse hollow Pyramid with stars
  11. Print Reverse hollow Pyramid with numbers
  12. Print Reverse hollow Pyramid with alphabets
  13. Print Square shape with stars Java
  14. Print Square shape with numbers Java
  15. Print Square shape with alphabets Java

Files

  1. Create a file with a name
  2. Write content to file
  3. Rename a file
  4. Read content from a file
  5. Check size of a file
  6. Get File created data and last modified date
  7. List files in a folder
  8. Create a folder
  9. Rename folder
  10. Delete a folder

Difficult

  1. Reverse a number
  2. Check given number Palindrome or not
  3. Check given number Armstrong number or not
  4. Average of given n numbers
  5. Find most repeated word from a file