Sum square difference Program in java

The sum of the squares of the first ten natural numbers is,

12 + 22 + … + 102 = 385

The square of the sum of the first ten natural numbers is,

(1 + 2 + … + 10)2 = 552 = 3025

Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

Source Code:

public class SumSquareDifference {

public static void main(String s[]){

long k=0;

long j=0;

for(int i=1;i<=100;i++){

k=k+(i*i);

j=j+i;

}

System.out.println((j*j)-k);

}

}

Largest prime factor of the number in JAVA

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

Source Code:

import java.util.Scanner;

public class LargestPrimeNumber {

	public static void main(String s[]){
		
		System.out.println("Enter number for Prime Factor: ");
		Scanner obj =new Scanner(System.in);
		
		long j =obj.nextLong();
		long i;
		long k=0;
		
				for(i=2; i<j;i++){
					if(j%i==0){
						k=i;
						j=j/i;
					}
				}
				System.out.println("Largest Prime factor  is : "+ j);
	   }
}

C programming (More Maths Functions)

Hello,

In this post i will be sharing you awesome code that i just wrote, I tried to cover every basic maths function like Addition,Subtraction, Multiplication, division, remainders.

#include <stdio.h>
#include <conio.h>

int main(void)
{
    int num1,num2,sum,mult,div,sub,rem;
    printf ("Enter the first value : ");
    scanf ("%d",&num1);
    
    printf ("Enter the second value : ");
    scanf ("%d",&num2);
    
    sum=num1+num2; // Sum Function
    mult=num1*num2; // Multiplication Funtion
    div=num1/num2; //Division Function
    sub=num1-num2; //Subtraction Function
    rem=num1%num2; //Remainder Function
    
    printf ("The sum is : %d\n",sum); 
    printf ("The multiplication is : %d\n",mult);
    printf ("The division is : %d\n",div);
    printf ("The subsctraction is : %d\n",sub);
    printf ("The remainder is : %d\n",rem);
    
    getch();
    
    
    }

.

C programming (Simple addition of variables using Math function)

Hello,

So well in this post i will going to share my source code that i just wrote on how you can use Variables, and maths functions to so simple addition calculation.

#include <stdio.h>
#include <conio.h>

int main(void)
{
    int num1,num2,sum;// Defining variables
 
    printf ("Enter the first value : ");// To print on screen
    scanf ("%d",&num1); // scanf use for inputting and storing data in variable 
    
    printf ("Enter the second value : ");// To print on screen
    scanf ("%d",&num2);
    
    sum=num1+num2; // Math funtion for Addition 
  
    
    printf ("The sum is : %d\n",sum); // Funtion to Print Sum of two variables
    
    getch();
    
    
    }

.

Started to Learn “C” Programming

After a long researches to start to learn to write a program.We need to be good in our basics which is all depends on practices, I choose to begin with “C” language, As C is one of the most widely used programming languages of all time and there are very few computer architectures for which a C compiler does not exist. C has greatly influenced many other popular programming languages, most notably C++, which began as an extension to C..

You should know how to earn money in teenage !

Well guys this post is not all about where i will spoon feed any kind of strategy or going to reveal any kind of method to succeed in such age. Well quite years ago my mom were used to say all much things about my elder brother amit aggarwal that he started to earn money from his early age by teaching students while he studying for college. Those things always boost me for some time and the next very day i get back to my normal mood. One day my mind sticks with an idea about how about to make some money in the very small age that can full fill all my needs.  That time i use to get 300rs/ month as pocket money yam you read it right! Only 6$ roughly which is quite nothing. Well that time i felt really bad about how will i going to manage my whole month with those small 6$:O. So surprisingly while browsing on internet my eyes stop on something like get 0.04$/day by clicking ads and the minimum cash out amount is 2$ i use to follow up that shitty program to earn few bucks per month. The day when i receive my payment of 2$ i was shocked and was so happy. I let one of my friend sachin know about it and ask him to join the same program. We both were happy and earning few bucks a month. Well that’s happens if you earn money with your efforts for the 1st time you will feel soo great. That’s what i felt at the moment when i got my money.

Now fast forwarding the story a bit i keep following and clicking ads for months….and asked my many friends to join that program after collecting 2 bucks per months i reached to some 14$ finally one day and was able to get my own site domain. Can anybody guess what domain? Well that’s Softwarelint.com The day i got domain i wasn’t familiar with so kind of hosting stuffs and not having such fee to pay hosting company to host my domain. That’s the point pushed me to next level. I don’t want to waste my domain i get it host to free hosting with uCoz.

After a few months Vishal sir came to know about my site and things i m doing online. He was amazingly impressed with my dedication towards my site and my future company Softwarelint. He is one of the best IT guy out there in my eyes that time ha-ha…well now also he is. He offered me cpanel having limited resources to host my domain and tell me about i should go with wordpress kind of stuffs. I’m always mad about new things and stuffs. That particular time i was very happy and explored the real thing. I create lots of stuffs on that host and with my domain. One day my site went down and i reported that issue to sir. He was helpless to me and my site remains down for weeks and weeks. Many may pack their bags of dreams. But that time my mind wasn’t stable after a month i partnership with a guy having hosting for me. I host my site over there and keep optimizing my site to use less resources, everything goes fine for months and i was keep working and exploring new world of internet and businesses.

While running my site Softwarelint i maintain to make it an cool wares download site portal and that time I came up with some PPD pay per downloads kind of affiliate stuffs. That was new thing to me and i made my first 220$ that time. Now you can imagine 14$ to directly 220$ is huge. After got that huge money i invested them all to my hosting and keep my site running on my personal host. This is how i keep making lots of money and maintaining my site that time.

Well guys not going to deep now. Yeah! You see how i started to earn extra cash + knowledge in my teenage. Those days still boosting me to move over and over. That’s make me not to fail in my field.

Thanks for reading my 1st business success story  and sorry for my bad English ha-ha… hope you all like it please leave comments.

 .

Personal | IM | Business | Self Development | Media | Tech blog