Monday 15 August 2016

How to Publish a Website in Windows Azure

Hi guys, today I will show you how to publish a website in windows azure. In my previous articles I had posted on How to create a WebApp in Windows azure.

Please follow the steps

Step 1 :
Create a Asp.net website in VS2013

Step 2:

Click on Server Explorer -> Right Click on WindowsAzure -> Import Subscriptions


Note: If you will not get Windows Azure in you Server Explorer , then please install Azure Sdk.

Step 3:

Click on the Download Subscription file. It will download subscription file. Then Select the downloaded file. Click on Import.

Step 4:

After that when you will click on the website you will get list of website name which you have created in the windows azure. How to create a WebApp in Windows azure.


 
Step 5:

Right Click on Website -> Download Publish Profile.

Step 6:

Now Right Click on your WebApplication -> Click on Publish -> Import the Publish Profile which you have downloaded -> Click on Next -> Click On Publish.

Step 7:


Now browse you Azure WebApp Url . You will get the result.

How to Create a WebApp in Azure

Hi guys, today I will show you how to create a webapp in windows azure. This article is really helpful for the beginners.

Please follow the steps.

Step 1:
Login to the windows azure portal https://manage.windowsazure.com

Step 2:
Click on New -> Compute -> WebApp ->Quick Create

After click on Quick Create link you will get


Please give the URL and Select  APP Service Plan. Then click on Create Web App.

Saturday 30 July 2016

Star Programming 7

Introduction


Hi guys, today I will show you how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous article was Star Programming 6

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = num; i>0; i--)
    {
        for (int k = i; k < num; k++)
        {
            Console.Write(" ");
        }
        for (int j = 0; j < i; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Star Programming 6

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous article was Star Programming 5

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
        for (int k = num-1; k > i; k--)
        {
            Console.Write(" ");
        }
        for (int j = 0; j <= i; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Star Programming 5

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous post was Star Programming 5 


static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
        for (int j = 0; j < i; j++)
        {
            if ((i + j) % 2 == 0)
                Console.Write("0");
            else
                Console.Write("1");
        }
        Console.WriteLine();
    }
}

Star Programming 4

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous post was Star Programming 3

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = num; i > 0; i--)
    {
        for (int j = 0; j < i; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Friday 29 July 2016

Star Programming 3

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous post was Star Programming 2

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = num; i>0; i--)
    {
        for (int k = num - i; k > 0; k--)
        {
            Console.Write(" ");
        }
        for (int j = 2*i-1; j>0; j--)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Thursday 28 July 2016

Star Programming 2

Introduction

Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.


Previously I had posted   Star Programming 1        


static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
        for (int k = 0; k < num - i-1; k++)
        {
            Console.Write(" ");
        }
        for (int j = 0; j <2 * i + 1; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Star Programming 1

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews. Slowly I will post more Star Programming related articles.

*
**
***
****
*****
******
*******
********

static void Main(string[] args)
{
    Console.WriteLine("Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
       for (int j = 0; j <= i; j++)
       {
           Console.Write("*");
       }
       Console.WriteLine();
    }
}

Tuesday 2 February 2016

Project Euler #5 : Smallest multiple

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

Solution
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
    static void Main(String[] args) {
         int testCases = Convert.ToInt32(Console.ReadLine());
            int[] numbers = new int[testCases];
            for (int i = 0; i < testCases; i++)
            {
                numbers[i] = Convert.ToInt32(Console.ReadLine());
            }
            foreach (int number in numbers)
            {
                long product = 1;
                for (int i = 2; i <= number; i++)
                {
                    if(IsPrime(i))
                    {
                        int temp = i;
                        for(int j=2;j<=number;j++)
                        {
                            if(Math.Pow(Convert.ToDouble(i),Convert.ToDouble(j))>number)
                            {
                                break;
                            }
                            else
                            {
                                temp = Convert.ToInt32(Math.Pow(Convert.ToDouble(i), Convert.ToDouble(j)));
                            }
                        }
                        product = product * temp;
                    }
                }
                Console.WriteLine(product);
            }
    }
    public static bool IsPrime(int number)
        {
            if (number == 2 || number == 3)
                return true;
            else
            {
                bool flag = true;
                for (int i = 2; i <= Math.Sqrt(number); i++)
                {
                    if (number % i == 0)
                    {
                        flag = false;
                        break;
                    }
                }
                return flag;
            }
        }
}

Project Euler #4 : Largest palindrome product

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers

Solution

using System;
using System.Collections.Generic;
using System.IO;
class Solution {
    static void Main(String[] args) {
         int testCases = Convert.ToInt32(Console.ReadLine());
            List<int> numbers = new List<int>();
            for (int k = 0; k < testCases; k++)
            {
                numbers.Add(Convert.ToInt32(Console.ReadLine()));
            }
            foreach (int number in numbers)
            {
                Console.WriteLine(FindLargestNumber(number));
            }
    }
    public static int FindLargestNumber(int number)
        {
            for (int x = 9; x >= 0; --x)
            {
                int a = x * 100001;
                for (int y = 9; y >= 0; --y)
                {
                    int b = a + y * 10010;
                    for (int z = 9; z >= 0; --z)
                    {
                        int n = b + z * 1100;
                        if (n < number)
                        {
                            for (int i = 990; i > 99; i -= 11)
                            {
                                if (n % i == 0)
                                {
                                    int t = n / i;
                                    if (t < 1000) return n;
                                }
                            }
                        }
                    }
                }
            }
            return 0;
        }
}