Monday 31 December 2012

Display your text with baloon popup extender.



Baloon Popup Extender………..

<body bgcolor="#ff99cc">
    <form id="form1" runat="server" style="background-color: #5C5CA3">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div style="background-color: #659A69">
        <i style="background-color: #FFFFFF">Textbox</i> <asp:TextBox ID="TextBox1" Runat="server" />
        <asp:Panel ID="Panel1" runat="server">
         <b>Hey
I am simple TextBox with BallonPopup</b>
            <br />
        </asp:Panel>
        <asp:BalloonPopupExtender ID="BalloonPopupExtender1" TargetControlID="TextBox1" BalloonPopupControlID="Panel1"  BalloonSize="Medium" BalloonStyle="Cloud"
            UseShadow="true" runat="server">
        </asp:BalloonPopupExtender>
       
    </div>
    
    </form>

The BalloonPopupExtender is initialized with this code. The italic properties are optional:
<ajaxToolkit:BalloonPopupExtender ID="PopupControlExtender2" runat="server"
        TargetControlID="MessageTextBox"
        BalloonPopupControlID="Panel2"
        Position="BottomRight"
        BalloonStyle="Cloud"
        BalloonSize="Small"
        CustomCssUrl="CustomStyle/BalloonPopupOvalStyle.css"
        CustomClassName="oval"
        UseShadow="true"
        ScrollBars="Auto"
        DisplayOnMouseOver="true"
        DisplayOnFocus="false"
        DisplayOnClick="true" />
  • TargetControlID - The ID of the control to attach to.
  • BalloonPopupControlID - The ID of the control to display.
  • Position - Optional setting specifying where the popup should be positioned relative to the target control. (TopRight, TopLeft, BottomRight, BottomLeft, Auto) Default value is Auto.
  • OffsetX/OffsetY - The number of pixels to offset the Popup from its default position, as specified by Position. Default value is 0.
  • BalloonStyle - Optional setting specifying the theme of balloon popup. (Cloud, Rectangle, Custom). Default value is Rectangle.
  • BalloonSize - Optional setting specifying the size of balloon popup. (Small, Medium and Large). Default value is Small.
  • CustomCssUrl - This is required if user choose BalloonStyle to Custom. This specifies the url of custom css which will display custom theme.
  • CustomClassName - This is required if user choose BalloonStyle to Custom. This specifies the name of the css class for the custom theme.
  • UseShadow - Optional setting specifying whether to display shadow of balloon popup or not.
  • ScrollBars - Optional setting specifying whether to display scrollbar if contents are overflowing. This property contains 5 options - None, Horizontal, Vertical, Both and Auto. Default value is Auto.
  • DisplayOnMouseOver - Optional setting specifying whether to display balloon popup on the client onMouseOver event. Default value is false.
  • DisplayOnFocus - Optional setting specifying whether to display balloon popup on the client onFocus event. Default value is false.
  • DisplayOnClick - Optional setting specifying whether to display balloon popup on the client onClick event. Default value is true.
  • Animations - Generic animations for the PopupControlExtender.
    • OnShow - The OnShow animation will be played each time the popup is displayed. The popup will be positioned correctly but hidden. The animation can use <HideAction Visible="true" /> to display the popup along with any other visual effects.
    • OnHide - The OnHide animation will be played each time the popup is hidden.

Code for file handling


using System;
using System.IO;
namespace Console_FileHandling_P_
{
    class Program
    {
        public void writingText()
        {
            //For file Writing
            FileStream fs = new FileStream(@"D:\C# Console Prog 2012\Demo.txt", FileMode.Append, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs);
            Console.WriteLine("Enter your Name :");
            string nm = Console.ReadLine();
            Console.WriteLine("Enter your age :");
            int age = int.Parse(Console.ReadLine());
            sw.WriteLine("Hello! Your Name is :" + nm);
            sw.WriteLine("And age is : " + age);
            sw.Flush();
            sw.Close();
            fs.Close();
            Console.WriteLine("File has been created");
        }

        public void readingText()
        {
            // For file reading
            FileStream fs = new FileStream(@"D:\C# Console Prog 2012\Demo.txt", FileMode.Open, FileAccess.Read);
            StreamReader sr = new StreamReader(fs);
            string txt = sr.ReadLine();
            while (txt != null)
            {
                Console.WriteLine(txt);
                txt = sr.ReadLine();

            }
            sr.Close();
            fs.Close();
        }

        static void Main(string[] args)
        {
            Program prog = new Program();
            prog.writingText();
            prog.readingText();
            Console.ReadKey();

        }
    }
}

Code for registration form in ASP.NET to display output on Labels

.cs code for registration form
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
                txtName.Focus();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
     
        //Code for Name
        lblDispName.Text = txtName.Text;
     
        //Code for Password
        lblDispPwd.Text = txtPwd.Text;

        //Code for Confirm Password
        lblDispConfPwd.Text = txtConfPwd.Text;

        //Code for Email
        lblDispEmail.Text = txtEmail.Text;

        //Code for Radioboxes
        if (rbMale.Checked==true)
        {
            lblDispGender.Text = rbMale.Text;
        }
        else if (rbFemale.Checked==true)
        {
            lblDispGender.Text = rbFemale.Text;
        }

        //Code for Checkboxes
        string check = "";
        if (cbCricket.Checked)
            check +=cbCricket.Text + " ";
        if(cbSwimming.Checked)
            check += cbSwimming.Text + " ";
        if(cbPool.Checked)
            check += cbPool.Text;
        lblDispHobbies.Text = check;

        //Code for Dropdownlist
     
        //Method 1
        //DateTime dt = new DateTime();
        //dt = System.DateTime.Now;
        //int day = dt.Day;
        //int month = dt.Month;
        //int year = dt.Year;
        //ddlDay.SelectedValue = day.ToString();
        //ddlMonth.SelectedValue = month.ToString();
        //ddlYear.SelectedValue = year.ToString();
     
        //Method 2
        DateTime dt=new DateTime();
        string sdate = dt.ToString();
        string smonth = dt.ToString();
        string syear = dt.ToString();
        ddlDay.SelectedValue = sdate;
        ddlMonth.SelectedValue = smonth;
        ddlYear.SelectedValue = syear;
        lblDispDOB.Text = ddlDay.SelectedValue + "/" + ddlMonth.SelectedValue + "/" + ddlYear.SelectedValue;
        //Convert.ToDateTime(lblDispDOB.Text.ToString());
        //Note: but be sure if any one select Feb and day  = 30 or 31 then it will show error....

        //Code for Address
        lblDispAddr.Text = txtAddr.Text;
    }
}

.aspx code for registration form


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link rel="stylesheet" href="Styles/ValidationStyle.css" type="text/css" />
 <script src="http://YOURJQUERYPATH/js/jquery.js" type="text/javascript"></script>
<script src="http://YOURJQUERYPATH/js/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
function isNumberKey(textboxvalue)
      {
          evt=textboxvalue.text;
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            textboxvalue.text="Enter in Integer Only";
            return false;

         return true;
      }
     </script>
    <style type="text/css">
     
        #mainBody
        {
            width: 100%;
            height: 100%;
            background-color:Maroon;
        }
         #form1
        {
            width: 1000px;
            height: 1050px;
            background-color:Silver;
            border:1px solid black;
            margin-left:12%;
            margin-top:10px;
        }
        .maindiv
        {
            width:900;
            height: 1050px;
        }
        .divTable1
        {
            width: 400px;
            height: 455px;
            margin-top:38px;
            margin-right:5%;
            border:1px solid black;
            float:right;
        }
        .divTable2
        {
            width: 400px;
            height: 400px;
            margin-right: 5%;
            margin-top: 20px;
           border:1px solid black;
           float:right;
        }
        .divTable1 .table1
        {
            width: 400px;
            height: 455px;
            border:1px solid black;
            background-color:Yellow;
        }
        .divTable2 .table2
        {
            width: 400px;
            height: 400px;
            border:1px solid black;
            background-color:Lime;
        }
        .divTable1 .table1 .input
        {
       text-shadow: 1px 1px 0 #FFFFFF;
            text-align: center;
        }
        .style1
        {
            color: #FF0000;
        }
    </style>
</head>
<body id="mainBody">
    <form id="form1" runat="server">
   <div class="maindiv">
        <div class="divTable1">
    <table class="table1">
        <tr>
            <td colspan="2" style="text-align: center">
                <h1>Registration Form</h1>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style1" style="text-align: right">
                *All Fields are required</td>
        </tr>
        <tr>
            <td>
                <asp:Label  ID="lblName" runat="server" Text="Name"></asp:Label>
            </td>
            <td class="input">
                <asp:TextBox ID="txtName" runat="server"  Width="150px" TabIndex="1"
                    ontextchanged="txtName_TextChanged"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="txtName" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblPwd" runat="server" Text="Pasword"></asp:Label>
            </td>
            <td class="input">
                <asp:TextBox ID="txtPwd" runat="server" Width="150px" TextMode="Password"
                    TabIndex="2"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                    ControlToValidate="txtPwd" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblConfPwd" runat="server" Text="Confirm Password"></asp:Label>
            </td>
            <td class="input">
                <asp:TextBox ID="txtConfPwd" runat="server" Width="150px" TextMode="Password"
                    TabIndex="3"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                    ControlToValidate="txtConfPwd" ErrorMessage="*"></asp:RequiredFieldValidator>
                <asp:CompareValidator ID="CompareValidator1" runat="server"
                    ErrorMessage="Pwd Not Matching" ControlToCompare="txtPwd"
                    ControlToValidate="txtConfPwd"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td class="input">
                <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtEmail" runat="server" Width="150px" TabIndex="4"></asp:TextBox>
                <br />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                    ControlToValidate="txtEmail" ErrorMessage="*"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                    ControlToValidate="txtEmail" ErrorMessage="Email should be in correct format"
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblGender" runat="server" Text="Gender"></asp:Label>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                <asp:RadioButton ID="rbMale" runat="server" Text="Male" TabIndex="5" GroupName="g"
                                oncheckedchanged="rbMale_CheckedChanged" />
                        </td>
                        <td>
                <asp:RadioButton ID="rbFemale" runat="server" Text="Female" TabIndex="6" GroupName="g" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblHobbies" runat="server" Text="Hobbies"></asp:Label>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                <asp:CheckBox ID="cbCricket" runat="server" Text="Cricket" TabIndex="7" />
                        </td>
                        <td>
                <asp:CheckBox ID="cbSwimming" runat="server" Text="Swimming" TabIndex="8" />
                        </td>
                        <td>
                <asp:CheckBox ID="cbPool" runat="server" Text="Pool" TabIndex="9" />
                           
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblDOB" runat="server" Text="DOB"></asp:Label>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
               <asp:DropDownList ID="ddlDay" runat="server" TabIndex="10">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
            <asp:ListItem>3</asp:ListItem>
            <asp:ListItem>4</asp:ListItem>
            <asp:ListItem>5</asp:ListItem>
            <asp:ListItem>6</asp:ListItem>
            <asp:ListItem>7</asp:ListItem>
            <asp:ListItem>9</asp:ListItem>
            <asp:ListItem>10</asp:ListItem>
            <asp:ListItem>11</asp:ListItem>
            <asp:ListItem>12</asp:ListItem>
            <asp:ListItem>13</asp:ListItem>
            <asp:ListItem>14</asp:ListItem>
            <asp:ListItem>15</asp:ListItem>
            <asp:ListItem>16</asp:ListItem>
            <asp:ListItem>17</asp:ListItem>
            <asp:ListItem>18</asp:ListItem>
            <asp:ListItem>19</asp:ListItem>
            <asp:ListItem>20</asp:ListItem>
            <asp:ListItem>21</asp:ListItem>
            <asp:ListItem>22</asp:ListItem>
            <asp:ListItem>23</asp:ListItem>
            <asp:ListItem>24</asp:ListItem>
            <asp:ListItem>25</asp:ListItem>
            <asp:ListItem>26</asp:ListItem>
            <asp:ListItem>27</asp:ListItem>
            <asp:ListItem>28</asp:ListItem>
            <asp:ListItem>29</asp:ListItem>
            <asp:ListItem>30</asp:ListItem>
            <asp:ListItem>31</asp:ListItem>
            <asp:ListItem></asp:ListItem>
        </asp:DropDownList>

                        </td>
                        <td>
               <asp:DropDownList ID="ddlMonth" runat="server" TabIndex="11">
        <asp:ListItem>Jan</asp:ListItem>
        <asp:ListItem>Feb</asp:ListItem>
        <asp:ListItem>Mar</asp:ListItem>
        <asp:ListItem>Apr</asp:ListItem>
        <asp:ListItem>May</asp:ListItem>
        <asp:ListItem>Jun</asp:ListItem>
        <asp:ListItem>Jul</asp:ListItem>
        <asp:ListItem>Aug</asp:ListItem>
        <asp:ListItem>Sep</asp:ListItem>
        <asp:ListItem>Oct</asp:ListItem>
        <asp:ListItem>Nov</asp:ListItem>
        <asp:ListItem>Dec</asp:ListItem>      
        </asp:DropDownList>
                        </td>
                        <td>
                 <asp:DropDownList ID="ddlYear" runat="server" TabIndex="12">
         <asp:ListItem>2006</asp:ListItem>
         <asp:ListItem>2007</asp:ListItem>
         <asp:ListItem>2008</asp:ListItem>
         <asp:ListItem>2009</asp:ListItem>
         <asp:ListItem>2010</asp:ListItem>
         <asp:ListItem>2011</asp:ListItem>
         <asp:ListItem>2012</asp:ListItem>
         <asp:ListItem>2013</asp:ListItem>
         <asp:ListItem>2014</asp:ListItem>
        </asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblAddr" runat="server" Text="Address"></asp:Label>
            </td >
            <td class="input">
                <asp:TextBox ID="txtAddr" runat="server" TextMode="MultiLine" Width="222px"
                    TabIndex="13"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                    ControlToValidate="txtAddr" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="104px"
                    onclick="btnSubmit_Click" BackColor="#CC99FF" TabIndex="14" />
            </td>
        </tr>
    </table>
        </div>
        <br />
        <div class ="divTable2">
        <table class="table2">
            <tr>
            <td >
                <asp:Label ID="Lable9" runat="server" Text="Name"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispName" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label10" runat="server" Text="Pasword"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispPwd" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label11" runat="server" Text="Confirm Password"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispConfPwd" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label12" runat="server" Text="Email"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispEmail" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label13" runat="server" Text="Gender"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispGender" runat="server"></asp:Label>
&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label14" runat="server" Text="Hobbies"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispHobbies" runat="server"></asp:Label>
&nbsp;
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label15" runat="server" Text="DOB"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispDOB" runat="server"></asp:Label>
&nbsp;
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="Label16" runat="server" Text="Address"></asp:Label>
            </td>
                <td>
                    <asp:Label ID="lblDispAddr" runat="server"></asp:Label>
                </td>
            </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>

Monday 10 December 2012

Code for All types of Patterns

           WAP to draw a following pattern : 
            ////////////////////////////               *
            ////////////////////////////              **
            ////////////////////////////             ***
            ////////////////////////////            ****
            ////////////////////////////           *****
            //for (int i = 1; i <= 5; i++)
            //{

            //    for (int j = i; j < 5; j++)
            //    {
            //        Console.Write(" ");
            //    }

            //    for (int k = 1; k <= i; k++)
            //    {
            //        Console.Write("*");

            //    }
            //    Console.WriteLine("\n");
            //}


            WAP to draw a following pattern : 
            ////////////////////////////      *****
            ////////////////////////////      ****
            ////////////////////////////      ***
            ////////////////////////////      **
            ////////////////////////////      *
            ////////////////////////////      *****
            ////////////////////////////       ****  
            ////////////////////////////        ***
            ////////////////////////////         **
            ////////////////////////////          *

            //for (int row = 5; row >= 1; --row)
            //{
            //    for (int col = 1; col <= row; ++col)
            //    {
            //        Console.Write("*");
            //    }

            //    Console.WriteLine();
            //}

            //Console.WriteLine();

            //for (int row = 5; row >= 1; --row)
            //{
            //    for (int spaces = 0; spaces < 5 - row; ++spaces)
            //    {
            //        Console.Write(" ");
            //    }

            //    for (int col = 1; col <= row; ++col)
            //    {
            //        Console.Write("*");
            //    }

            //    Console.WriteLine();
            //}

           WAP to draw a following pattern : 
            /////////////////////////////////. *
            //////////////////////////////   ***
            /////////////////////////////  *****
            ///////////////////////////// *******
            ////////////////////////////*********

            //int row, c, n, temp;
            //Console.WriteLine("Enter the number of rows in pyramid of stars you wish to see ");
            //n = int.Parse(Console.ReadLine());
            //temp = n;
            //for (row = 1; row <= n; row++)
            //{
            //    for (c = 1; c < temp; c++)
            //        Console.Write(" ");

            //    temp--;

            //    for (c = 1; c <= 2 * row - 1; c++)
            //        Console.Write("*");

            //    Console.WriteLine("\n");
            //}


            WAP to draw a following pattern : 
            ////////////////////////////    1
            ////////////////////////////    0 1
            ////////////////////////////    1 0 1
            ////////////////////////////    0 1 0 1
            ////////////////////////////    1 0 1 0 1

            //int i, j,k;
            //Console.WriteLine("Enter the number of rows u wish to see :");
            //int n = int.Parse(Console.ReadLine());
            //for (i = 1; i <= n; i++)
            //{
            //    for (j = 1; j <= i; j++)
            //    {
            //        if (i % 2 == 0)
            //        {
            //            if (j % 2 == 0)
            //            {
            //                k = 1;
            //                Console.Write(k);
            //            }
            //            else
            //            {
            //                k = 0;
            //                Console.Write(k);
            //            }
            //        }
            //        else
            //        {
            //            if (j % 2 == 0)
            //            {
            //                k = 0;
            //                Console.Write(k);
            //            }
            //            else
            //            {
            //                k = 1;
            //                Console.Write(k);
            //            }
            //        }
            //    }
            //    Console.WriteLine();
            //}

           WAP to draw a following pattern : 
            ////////////////////////////////    *
            ///////////////////////////////   *A*
            //////////////////////////////  *A*A*
            //////////////////////////// *A*A*A*

            //int i, j, temp, count = 1;
            //Console.WriteLine("Enter number of rows \n");
            //int n = int.Parse(Console.ReadLine());
            //temp = n;
            //for (i = 1; i <= n; i++)
            //{
            //    for (j = 1; j < temp; j++)
            //        Console.Write(" ");
            //    temp--;
            //    for (j = 1; j <= i; j++)
            //    {
            //        Console.Write("*");

            //        if (i > 1 && count < i)
            //        {
            //            Console.Write("A");
            //            count++;
            //        }
            //    }
            //    Console.WriteLine("\n");
            //    //temp--;
            //    count = 1;
            //}


            WAP to draw a following pattern : 
            //////////////////////////////  1
            //////////////////////////////  22
            //////////////////////////////  333
            //////////////////////////////  4444
            //////////////////////////////  55555

            //int i, j;
            //Console.Write("Enter number of rows : ");
            //int n = int.Parse(Console.ReadLine());
            //for (i = 1; i <= n; i++)
            //{
            //    for (j = 1; j <= i; j++)
            //        Console.Write(i);

            //    Console.WriteLine("\n");
            //}


            WAP to draw a following pattern : 
            ////////////////////////////        *******
            ////////////////////////////        ***S***
            ////////////////////////////        **SSS**
            ////////////////////////////        *SSSSS*

            //int  i, j, space, temp;
            //Console.Write("Enter number of rows :");
            //int n = int.Parse(Console.ReadLine());
            //space = 1;
            //temp = n - 1;
            //for (i = 1; i <= 2 * n - 1; i++)
            //    Console.Write("*");
            //Console.WriteLine("\n");
            //for (j = 2; j <= n; j++)
            //{
            //    for (i = 1; i <= temp; i++)
            //        Console.Write("*");
            //    for (i = 1; i <= space; i++)
            //        Console.Write("S");
            //    space = 2 * j - 1;

            //    for (i = 1; i <= temp; i++)
            //        Console.Write("*");
            //    temp--;
            //    Console.WriteLine("\n");
            //}

           WAP to draw a following pattern : 
            ////////////////////////////////////      1
            ////////////////////////////////////      232
            ////////////////////////////////////      34543
            ////////////////////////////////////      4567654
            ////////////////////////////////////      567898765

            //int n, c, d, num = 1, space;

            //n = int.Parse(Console.ReadLine());

            //space = n - 1;

            //for (d = 1; d <= n; d++)
            //{
            //    num = d;

            //    for (c = 1; c <= space; c++)
            //        Console.Write(" ");

            //    space--;

            //    for (c = 1; c <= d; c++)
            //    {
            //        Console.Write(num);
            //        num++;
            //    }
            //    num--;
            //    num--;
            //    for (c = 1; c < d; c++)
            //    {
            //        Console.Write(num);
            //        num--;
            //    }
            //    Console.WriteLine("\n");

            //}

Code for Multiplication of Table

using System;
namespace Console_Table
{
    class table
    {
       
        int i=1,count;
        public void dispTable()                               //using "do-while loop"
        {
            Console.Write("Enter the number for table : ");
            int inputnum1 = int.Parse(Console.ReadLine());
            Console.Write("Enter the number up to which you want to see the table :");
            int inputnum2 = int.Parse(Console.ReadLine());
            do
            {
                count = inputnum1 * i;
                i++;
                Console.WriteLine(count);

            } while (i <= inputnum2);
        }

        //public void dispTable()                               //using "For loop"
        //{
        //    Console.WriteLine("Enter the number for table :");
        //    int inputnum1 = int.Parse(Console.ReadLine());
        //    Console.WriteLine("Enter the number upto which you want to see the table :");
        //    int inputnum2 = int.Parse(Console.ReadLine());
        //    Console.WriteLine("_________________________________________________________");
        //    Console.WriteLine("Table Number {0} :", inputnum1);
        //    for (i = 1; i <= inputnum2; i++)
        //    {
        //        count = inputnum1 * i;
        //        Console.WriteLine("\t\t\t{0}  *  {1}   =   {2} ",inputnum1,i,count );
               
        //    }
        //    Console.WriteLine("_________________________________________________________");

        //}

        //public void dispTable()                                 //using "While-loop"
        //{
        //    Console.WriteLine("Enter the number for table :");
        //    int inputnum1 = int.Parse(Console.ReadLine());
        //    Console.WriteLine("Enter the number upto which you want to see the table :");
        //    int inputnum2 = int.Parse(Console.ReadLine());
        //    while (i <= inputnum2)
        //    {
        //        count = inputnum1 * i;
        //        Console.WriteLine("{0} * {1} = {2}", inputnum1, i, count);
        //        i++;
        //    }
        //}

        static void Main(string[] args)
        {
            table t = new table();
            t.dispTable();
            Console.ReadKey();
        }
    }
}

Code for Reverse Number

using System;
namespace Console_ReverseNo
{
    class ReverseNo
    {
        public void dispRev()
        {
            Console.WriteLine("Enter a Number");
            int numb = int.Parse(Console.ReadLine());
            int reverse = 0;
            while (numb > 0)
            {
                int rem = numb % 10;
                reverse = (reverse * 10) + rem;
                numb = numb / 10;

            }
            Console.WriteLine("Reverse number={0}", reverse);
        }
        static void Main(string[] args)
        {
            ReverseNo rn = new ReverseNo();
            rn.dispRev();
            Console.ReadKey();
        }
    }
}

Code for Reverse String

using System;
namespace Console_ReverseString
{
    class ReverseString
    {
        //Using While Loop

        public void dispRevStr()
        {
            string Str, Revstr = "";
            int Length;

            Console.Write("Enter A String : ");
            Str = Console.ReadLine();

            Length = Str.Length - 1;

            while (Length >= 0)
            {

                Revstr = Revstr + Str[Length];
                Length--;

            }

            Console.WriteLine("Reverse  String  Is  {0}", Revstr);
        }


        //Using For loop

        //public void dispRevStr()
        //{
        //    string Str, Revstr = "";
        //    Console.Write("Enter A String : ");
        //    Str = Console.ReadLine();

        //    for (int i = Str.Length - 1; i >= 0; i--)
        //    {

        //        Revstr = Revstr + Str[i];
        //    }

        //    Console.WriteLine("Reverse  String  Is  {0}", Revstr);
        //    Console.ReadLine();
        //}

        static void Main(string[] args)
        {
            ReverseString rs = new ReverseString();
            rs.dispRevStr();
            Console.ReadKey();
        }
    }
}