Wednesday, 30 May 2018

Ceil ,Floor ,Square root , Power and Absolute function in C Language





#include <stdio.h>

#include <math.h>



main()

{



printf("Ceil function:   %f ",ceil(4.000001));

//4.1 =4.2=4.3=4.4 =4.0

//4.5 =4.5

//4.6 =4.7=4.8=4.9= 5.0



printf("\nfloor function : %f ",floor(4.000001));





printf("\nSquare root function : %f ",sqrt(4.0001));



printf("\nPower function : %f ",pow(2,3));



printf("\nAbsolute function : %d ",abs(2));







}

Tuesday, 29 May 2018

Stack Class generic Collection in C#





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication32

{

    class Program

    {

        static void Main(string[] args)

        {





            Stack<string> s = new Stack<string>();

            s.Push("ALI");

            s.Push("Ahmed");

            s.Push("Basit");

            s.Push("zahid");

            s.Push("danish");

            s.Push("hasan");





            foreach (var item in s)

            {

                Console.WriteLine(item);

            }

            Console.WriteLine("Top Element is "+s.Peek());

            Console.WriteLine("press any key to pop element : ");

            Console.ReadKey();

            s.Pop();

            Console.WriteLine("Top Element is " + s.Peek());

            foreach (var item in s)

            {

                Console.WriteLine(item);

            }



            Console.ReadLine();

         



        }

    }

}


Sorted Set Class in C#





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication32

{

    class Program

    {

        static void Main(string[] args)

        {



            var x = new SortedSet<string>();

            x.Add("Zahid");

            x.Add("Ali");

            x.Add("Bilal");

            x.Add("Danish");

            x.Add("ali");



            foreach (var item in x)

            {

                Console.WriteLine(item);

            }



            Console.ReadLine();

         



        }

    }

}


Hash set Generic Class in C#





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication32

{

    class Program

    {

        static void Main(string[] args)

        {



            var x = new HashSet<string>();



            x.Add("ali");

            x.Add("AHMED");

            x.Add("ali"); //DUPLICATE......

            x.Add("ARIF");

            x.Add("ASIM");





            foreach (var item in x)

            {

                Console.WriteLine(item);

            }



            Console.ReadLine();





        }

    }

}


Monday, 28 May 2018

convert upper to lower





#include <stdio.h>

#include <conio.h>

#include <string.h>





main()

{

char c[50],f;

printf("Enter the string: ");

gets(c);

int len=strlen(c),i=0,t;

char d[len];

while(i<len)

{

t=(int)c[i];

if(t>=65 && t<=90)

{

t=t+32;

}

f=(char)t;

d[i]=f;



i++;

}



puts(d);





}

Friday, 25 May 2018

Check Palindrome using string function String copy , string Reverse, String







#include<stdio.h>

#include<conio.h>

#include <string.h>



main()

{



char s[50];

char d[50];

char t[50];



l1:

printf("Enter the string: ");

gets(s);



strcpy(t,s);





strcpy(d,strrev(s));



if(strcmp(t,d)==0)

{

printf("INPUT IS PALINDROME");



}

else

{

printf("INPUT IS NOT PALINDROME");





}

printf("\n\n\--------------------\n\n");

goto l1;



}




String Concat join function in C Language





#include<stdio.h>

#include<conio.h>

#include <string.h>



main()

{



char f[50];

char l[50];



printf("Enter the first name: ");

gets(f);



printf("\nEnter the Last name: ");

gets(l);



strcat(f,l);



puts(l);



}

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...