- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Rishikesh Kumar Rishi has Published 1162 Articles
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
92 Views
StepsTake a value from the user and store it in a variable (n).Use a for loop where the value of i ranges between the values of 1 and n.Print the value of i and '+' operator.Find the sum of elements in the list.Print '=' followed by the total sum.Exit.ExplanationUser must ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
304 Views
Let's assume the range is from 0 to 50. We have to print all the integers that aren't divisible by either 2 or 3.StepsUse a for loop ranging from 0 to 50.Then, use an if statement to check if the number isn't divisible by both 2 and 3.Print the numbers ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
3K+ Views
Suppose the number is: 123456Count of digits in the given number is: 6To count the number of digits in a number, we can take followingStepsTake the value of the integer and store in a variable.Using a while loop, get each digit of the number and increment the count each time ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
300 Views
Consider that the integer is: 75Divisor of that integer is: 3, 5, 15, ..., 75The smallest divisor is: 3StepsTake an integer from the user.Initialize a variable (res) with that number.Use a for loop where the value of i ranges from 2 to the integer.If the number is divisible by i, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
348 Views
To print odd number in a range, we can take two inputs, a and b, for lower and upper limits.Examplea = 2 and b = 9Numbers between a and b are: 2, 3, 4, 5, 6, 7, 8, 9Odd numbers are: 3, 5, 7, 9StepsDefine two numbers, a and b.Take ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
454 Views
Let's enter the marks: 89 56 90 67 99Sum of the marks is: 89+56+90+67+99 => 401Avg. = 401/5 = 80.1The steps are as follows:Define variables for 5 subjects.Enter marks for 5 subjects.Find average of the marks to find grade.Use if else block to print grade.Example Live Demopackage main import "fmt" func ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
250 Views
Let's read a number, n=5Then, nn=55 and then nnn=555res = 5 + 55 + 555 => 615To read a number (n) and compute (n+nn+nnn), we can take the followingStepsDefine a variable, n.Print a statement to get the number, n.Take user input for variable, n.Make an expression for (n + nn ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
996 Views
Input array is: [2, 4, 1, 6, 5]Sum = 2 + 4 + 1 + 6 + 5 => 18Average = 18/5 => 3.6 ~ 3To calculate the average of numbers in a given list, we can take following steps −Let's take an input list of numbers.Find the sum of ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
893 Views
To create a class that can perform basic calculator operations, we can take following StepsWe can define a Calculator class with two numbers, a and b.Define a member method to calculate the addition of two numbers.Define a member method to calculate the multiplication of two numbers.Define a member method to ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
353 Views
To compute the area and perimeter of a circle, we can take following steps −Define a struct with circle properties such as radius.Define a method to calculate the area of the circle.Define a method to calculate the perimeter of the circle.In the main method, take the user's input for circle's ... Read More