Monday 28 January 2013



// Write a program to print the area of a circle.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace areaofcircle
{
    class Program
    {
        static void Main(string[] args)
        {
            int r;
            double a, p;
            p = 3.14;
            Console.WriteLine("Enter the value of radius");
            r = Convert.ToInt32(Console.ReadLine());
            a = p * r * r;
            Console.WriteLine("area" + a);
            Console.ReadLine();

        }
    }
}


// Write a program to print the fibonacci series

using System
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace fibo
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, i, pre = 0;
            int next = 1;
            Console.WriteLine("Enter the value of n:  ");
            n = Convert.ToInt32(Console.ReadLine());
            for (i = 2; i <= n; i++)
            {
                int a = pre + next;
                Console.WriteLine(" " + a);
                pre = next;
                next = a;
            }
            Console.ReadKey();
            }
        }
    }


// Write a program to print the table of a number

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Table
{
    class Program
    {
        static void Main(string[] args)
        {
            int i,a,n;
            Console.WriteLine("Enter the number");
            n= Convert.ToInt32(Console.ReadLine());
            for(i=1;i<= 10;i++)
            {
                a=n*i;
                Console.WriteLine(a);
            }
            Console.ReadKey();
        }
    }
}

Its all About HARD WORK and PASSION !!


Today we all had a meeting with Sudeep, he discussed very Good and Inspiring thoughts with us like, How to do a better programming ?How to make our self a Good Programmer ? etc. The most important of all he spoke about the HARD WORK. Sudeep said ' To be a good Programmer u need to do a lot of Hard work and need to Fall in love with the Programming'. Apart from this he shared many other thoughts that surely going to Groom us in the upcoming months, if ll do the hard work.


// Write a program that prints

//*
//**
//***
//****

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 1; i <= 4; i++)
            {
              
                for (int j = 1; j <= i; j++)
                {
                    Console.Write("*");
                }

                Console.WriteLine();
            }
            Console.ReadKey();
        }
    }
}


// Write a program to take as input your name and print “Hello name”.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            string name = string.Empty;
            Console.WriteLine("Enter your Name:");
            name = Console.ReadLine();
            Console.Clear();
            Console.Write("\n");
            Console.WriteLine("Hello " + name);
            Console.ReadKey();
        }  
    }
}

// Write a program to find out m % n without using the % operator.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace prog7
{
    class Program
    {
        static void Main(string[] args)
         {
            int n = 0, m = 0, def=0;
 
            Console.WriteLine("Enter M value");
 
            m = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter Nvalue");
            n = int.Parse(Console.ReadLine());
            if (n == 1)
                Console.WriteLine("Result   " +def);
            else
            {
                while (m > 1)
                {
                    m = m - n;
                    //Once it meet such a condition that m become lesser then n that's mean now we can't devide m number through n
                    if (m < n)
                        break;
                }
 
                //Moving to the next line 
                Console.WriteLine();
 
                //Printing the biggest number from n number 
                Console.WriteLine(" Result: " + m);
 
            }
 
            //Waiting for any keypress 
            Console.ReadKey();
        }
       }
     }

// Write a program to find out m / n without using the / operator
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace prog6
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 0, m = 0, d = 0;
            Console.WriteLine("Enter M value");
            m = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter Nvalue");
            n = int.Parse(Console.ReadLine());
            if (n == 1)
                Console.WriteLine("Result" + m);
            else
            {
                while (m > 1)
                {
                    m = m - n;
                    d++;
                }
                //Moving to the next line 
                Console.WriteLine();
                //Waiting for any keypress 
                Console.ReadKey();

            }
        }
    }
}

// Write the programs to print the even numbers between 1 to 100. 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace evennum
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ;
            {
                Console.WriteLine("the even numbers between 1 to 100 are :");
                for (n = 1; n <= 100; n++)
                    if(n%2==0)
                    //while (n <= 100)
              
                Console.WriteLine(n);
                Console.ReadKey();
             }
        }
    }
}