Advertisements

Aatul Palandurkar

Archive for February 2016

Objectives :

  • Write a program to compute sum of digits of a given number.
  • Write a program to find sum of digits of a given number.
  • Write a program to calculate sum of digits of a given number.
  • Write a program to compute sum of digits of a given integer number.
  • Write a program to compute sum of digits of a number entered via Command Line.
  • Write a program to compute sum of digits of a given number. Take input from Command Line.
  • Write a program to compute sum of digits of a given number. Take input using Scanner class.

Following is the Java Program to compute Sum of Digits of a given integer number;

Method 1 : Java Program to find Sum of Digits when number is entered from command line


class SumOfDigits
{
public static void main(String args[])
{
int n;
int a=0;
int sum=0;

//taking integer number from command line and parsing the same
n=Integer.parseInt(args[0]);

while(n!=0)
{
a=n%10;
n=n/10;
sum=sum+a;
}
System.out.println("Sum of digits: " + sum);
}
}

Steps to run above program via command line :

  1. Compilation : C:\JavaPrograms>javac SumOfDigits.java
  2. Interpretation : C:\JavaPrograms>java SumOfDigits 12345

Output : Sum of digits: 15

Method 2 : Java Program to find Sum of Digits if input is taken using Scanner class


import java.util.Scanner;

public class SumOfDigits {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int n;
int a=0;
System.out.print("Enter a positive number: ");
n = in.nextInt();

if (n <= 0)
System.out.println("You have entered a negative number.");
else {
int sum = 0;

while (n != 0) {

a=n%10;
n=n/10;
sum=sum+a;
}
System.out.println("Sum of digits: " + sum);
}
}
}

Steps to run above program via command line :

  1. Compilation : C:\JavaPrograms>javac SumOfDigits.java
  2. Interpretation : C:\JavaPrograms>java SumOfDigits 12345

Output :

Trial 1 : With positive number

Enter a positive number: 12345

Sum of digits: 15

Trial 2 : With negative number

Enter a positive number: -12345

You have entered a negative number.

Advertisements

Ringing-Bells-Freedom-2513

Register Now to Buy Freedom 251 Mobile Phone: Cheapest Smartphone Launched by Ringing Bells Booking starting on – 18 Feb 2016

Ringing Bells has launched the cheapest Smartphone Freedom 251 in India which is priced Rs 251. The company launched this phone on February 17, 2016. The phone is launched by Union Defence Minister Manohar Parrikar. The freedom 251 is queued with the Prime Minister Narendra Modi’s vision of empowering India. The is aimed at providing people Freedom to Flaunt, Freedom to Capture, Freedom to Connect, Freedom to Explore and Freedom to Talk.

Latest NEWS about Freedom 251 Mobile Phone:

The Online Freedom 251 Mobile sale is stopped today because of heavy traffic on the site, the company decide to resume to Online Mobile booking by tomorrow on 19th Feb 2016. It is not confirmed news but hope for the best and visit the page again to check the available option for Freedom 251 registration. If you have any more news about Freedom 251 mobile phone then use comment section to give inputs.

Still it is  unclear that whether Ringbell Freedom 251 will be available on Paytm, Flipkart, Snapdeal or Amazon.com. We will update you if the Smartphone will be available for sale online on said sites. Meanwhile you can register for Freedom 251 on the given below link so you can cross the first step.

Freedom 251 Customer Care Number

0120-4200470, 6619680, 4001000

What is the next Freedom 251 Booking Timing and Launch Date

Mobile launched on 18 Jan 2016 but due to heavy traffic on site it postponed to tomorrow on 19 Feb 2016. Hopefully everything will be alright and again mobile will be ready for registration or buying.

Sale starts on 18th Feb 2016

New booking date – 19th Feb 2016

Closing on – 21st Feb 2016 at 8 PM

The government Mobile Freedom 251 was unveiled in grand ceremony on 17 Feb 2016 by Shri Manohar Parrikar. The mobile development got full support from Shri Narendra Modi government under the Make in India yojana. The phone comes with one year additional warranty.

How to buy Freedom 251 Mobile Phone

Visit the freedom251.com from your internet enabled mobile/laptop and click the buy button given on the site. Rest procedure is very simple, just have to put the right information, you used to provide on the online shopping sites like Flipkart, amazon, Ebay, Paytm and Shopclues.

Registration of Mobile is starting 18 Feb 2016 at 6 PM. so Buy Freedom 251 Mobile – Click here to register

Buy Online Freedom 251 on Amazon/ Flipkart, Launched by Ringing Bells on Wednesday 17 February 2016, Cheapest Smartphone on Amazon/ Flipkart   

Ringing Bells Freedom 251 Specs:  The 1.3 GHz Quadcore Processor of Freedom 251 gives you fast and responsive performance. The phone has enough storage space of 1GB RAM and 8GB internal memory. It supports SD card which is expandable up to 32 GB. The 1450 mAh battery of the Smartphone gives you enough time without charging in between to use the mobile phone for talking, watching video or playing games. The 4 inch Smartphone has HD display and it gives you freedom to watch videos, images and to play games. The 3.2 Mega Pixel auto focus camera and 0.3 Mega Pixel front camera gives you freedom to capture images and have facility to take Selfie in reliable cost of the Smartphone. You will remain connected to your family and friends anytime and anywhere.

Flipkart Freedom 251– Available Soon  

Ebay Freedom 251 Mobile – Not Available

Paytm Freedom 251 Cellphone – Not Available

Amazon Freedom 251– Available Soon

You get 1 year of warranty on Freedom 251, the cheapest Smartphone manufactured in India. There are more than 650 service centres present across India. Dual SIM, front camera, 3G GSM and many more features are available in Smartphone at only Rs 250. You can enjoy the freedom through the lowest price Smartphone.

Freedom 251 Mobile Price in India – Rs 251 Only

Once Freedom 251 Phone available online, we will let you the procedure to How to buy Freedom 251 Mobile Phone from Flipkart, Snapdeal, Amazon India & Paytm.com. Till then wait for news. Just log on the freedom251.com and buy this cheapest mobile.

Source : Promo Coders


Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 7,294 other followers

Atul Palandurkar

Tweets

%d bloggers like this: