Blogger Tips And Tricks|Latest Tips For Bloggers Free Backlinks

Monday 19 November 2012

Write a program to memory set memset() function in C language examples?

memset(),memory set,memset() function, memory set function,memset() in C,memory set in C,program to memory set function,program to memset() function,Write a program to memory set memset() function in C language,memset() in c language


memset() function

              To set all bytes in a block to a particular value,by use memset() function.

     Syntax

               void *memset(void destination,int set_value,size_t count);

   Program

                   #include<stdio.h>
                    char a[100] = "God gift programming";
                   main()
                   {
                         memset(a+2,'*',10);
                  
                         printf("After memset : %s\n",a);

                    }

              Output
                            After memset :  Go**********gramming
        In this case,from a[2] position to 10 positions are overlapped with *.i.e. memset().

                           

Sunday 18 November 2012

Write a program to memory move memmove() function in C language examples?

memmove(),memory move,memmove() function, memory move function,memmove() in C,memory move in C,program to memory move function,program to memmove() function,Write a program to memory move memmove() function in C language,memmove() in c language




 memmove() function

                   It copies the number of bytes from located pointed of source and it again copied into the located point of destination,In this case,the overlap will be occurring in the destination. i.e memmove() function.

syntax
              void *memmove(void *destination,void *source,size_t count);

 Program
            
                 #include<stdio.h>
                 main()
                 {
                       char str[] = "Programming";
             
                            memmove(str+1,str+3,4);

                     printf("After memory move  : %s\n",str);
                  }

    Output
                  After memory move :Pgramamaing

         Explanation 
                                 a[0]   1   2   3   4   5   6   7   8   9   10
                                   P     r    o   g    r    a   m  m   i   n     g
                    In memmove(str+1,str+3,4) function,from a[3] position to 4 bytes (a[6]) are copied and overlapped in destination string.So output is Pgramamaing. 

            

Saturday 17 November 2012

Write a program to memory copy memcpy() function in C language examples?

memcpy(),memory copy,memcpy() function, memory copy function,memcpy() in C,memory copy in C,program to memory copy function,program to memcpy() function,Write a program to memory copy memcpy() function in C language,memcpy() in c language


 memcpy() function

      It copies the bytes of data between memory blocks or buffers.This function doesn't care about the
              type of data being copied.
                    It simply makes an exact byte for byte copy.

               Syntax:- 
                               void *memcpy(void *destination,void *source,size_t count);
  Program

                  #include<stdio.h>
                  #include<string.h>
                  main()
                  {
                        char str1[100] = "This is string";
                        char str2[100];

                          memcpy(str2,str1,14);

                        printf("str2 = %s\n",str2);
                  }

       Output:-
                        str2 = This is string

     If you will give the 10 at the count(14),it copies only 10 bytes.It gives the o/p is "This is st".
 
          

Write a program to find the sub string in the main string using in C language examples?

Sub string in main string,sub string,sub string main string,find the sub string,sub string in main string using C,Write a program to find the sub string in the main string using in C language,program to sub string in main string,sub string program,C find sub string in main string,using C program language find sub string in main string


 Sub string in main string

                   See this video class for the good understanding of this concept and program .

Write a program to find the Reverse of the given string strrev() using pointers in C language examples?

Reverse of the string,string reverse,C string reverse,find string reverse,reverse of the string using pointers,find reverse of the string in C, Write a program to reverse of the given string using pointers in C language,string reverse program,find string reverse using pointers in C,find strrev()


 String Reverse

      The program is for reverse the given string in destination

                            #include<stdio.h>
                            void stringReverse(char *);

                            main()
                            {
                                  char source[100];

                                    printf("Enter String\n");
                                    scanf("%[^\n]",source);

                                       stringReverse(source);

                                      printf("After Reverse the string is : %s\n",source);
                             }
                             
                               void stringReverse(char *str)

                              {
                                            int len = 0,i=0;
                                            len = strlen(str);
                                             char *t = str + len - 1;
                 
                                          while(i < len/2)

                                               {
                                                     char temp = *str;
                                                     *str = *t;
                                                      *t = temp;
                                                     *str++;
                                                      *t-- ;
                                                      i++;
                                               }
                               }

                 Output:
                               Enter String
                                 Hello World
                                After Reverse the string :dlroW olleH

Write a program to find the copy of the given string strcpy() using pointers in C language examples?

Copy of the string,string copy,C string copy,find string copy,copy of the string using pointers,find copy of the string in C, Write a program to copy of the given string using pointers in C language,string copy program,find string copy using pointers in C,find strlcpy()


 String Copy

In this program,the given source string is copied into destination string.

                            #include<stdio.h>
                            void stringcopy(char *,char *);

                            main()
                            {
                                  char source[100],destination[100];

                                    printf("Enter String\n");
                                    scanf("%[^\n]",source);

                                       stringcopy(source,destination);

                                      printf("After copy the string is : %s\n",destination);
                             }
                             
                               void stringcopy(char *str1,char *str2)

                              {
                                                             
                                          while(*str1 != '\0')

                                               {
                                                     *str2 = *str1;
                                                     *str1++;
                                                      *str2++;
                                               }
                                     *str2 = '\0';
                               }

                 Output:
                               Enter String
                                 Welcome to C
                                After Copy the string : Welcome to C

Write a program to find the length of the given string strlen() using pointers in C language examples?

Length of the string,string length,C string length,find string length,length of the string using pointers,find length of the string in C, Write a program to find the length of the given string using pointers in C language,string length program,find string length using pointers in C,find strlen()


 String length

   The given program is for the find the length of the given string.

                           #include<stdio.h>
                            int stringlength(char *);

                            main()
                            {
                                  char source[100];
                                     int length;

                                    printf("Enter String\n");
                                    scanf("%[^\n]",source);

                                       length = stringlength(source);

                                      printf("The length of the string is : %d\n",length);
                             }
                             
                               int stringlength(char *str)

                              {
                                     int count = 0;
                   
                                          while(*str != '\0')

                                               {
                                                     *str++;
                                                       count++;
                                               }
                                   return count;
                               }

                 Output:
                               Enter String
                                 beonlyone
                                 The length of the string is : 9 

Friday 16 November 2012

Write a program to right Shift the given number using in C language examples?

Right Shift,right shift in C,program to right shift,right shift the given number,right shift the number,C right shift,write a program to right shift,right shift the given number using C,Write a program to right Shift the given number using in C language,C language right shift


 Right Shift

               If you Right shift the given number,the given value will become half to actual value.
               Suppose the given Right shift number is 2(input),output is 1
                                                                        6(input),output is 3
                                                                        9(input),output is 4
                  
                   The above logic is blind way to remember the left shift logic.


                  #include<stdio.h>
                   main()
                   {
                         int n,ls;

                           printf("Enter number\n");
                           scanf("%d",&n);

                                ls = n >> 1;

                            printf("After Right shift : %d\n",ls);
                    }

          Output:
                       Enter the number
                              10
                        After Right shift 5


Write a program to Left Shift the given number using in C language examples?

Left Shift,left shift in C,program to left shift,left shift the given number,left shift the number,C left shift,write a program to left shift,left shift the given number using C,Write a program to Left Shift the given number using in C language,C language left shift


Left Shift

               If you left shift the given number,the given value will become double to actual value.
               Suppose the given left shift number is 4(input),output is 8
                                                                        2(input),output is
                                                                        3(input),output is 6
                  
                   The above logic is blind way to remember the left shift logic.

   Program  

                 #include<stdio.h>
                   main()
                   {
                         int n,ls;

                           printf("Enter number\n");
                           scanf("%d",&n);

                                ls = n << 1;

                            printf("After left shift : %d\n",ls);
                    }

          Output:
                       Enter the number
                             4
                        After left shift  8

Thursday 15 November 2012

Write a program to Bit checking the given number using in C language examples?

Bit checking,program to bit checking,C bit checking,bit checking the number,bit checking the given number,C program to bit checking,bit checking program in C,bit checking in C,Write a program to Bit checking the given number using in C language,C program to bit checking the given number


  Bit checking

           This is for the checking the bit or bit checking.
  
                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n&(1<<pos);

                            printf("After bit checking : %d\n",n);
                  }

    Output:
                     Enter numbers
                          6
                          9 
                     After bit checking 0

Write a program to Bit toggle the given number using in C language examples?

Bit toggle,program to bit toggle,C bit toggle,bit toggle the number,bit toggle the given number,C program to bit toggle,bit toggle program in C,bit toggle in C,Write a program to Bit toggle the given number using in C language,C program to bit toggle the given number


  Bit toggle

         The program is for the Bit toggle.
                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n^(1<<pos);

                            printf("After bit toggling : %d\n",n);
                  }

    Output:
                     Enter numbers
                          6
                          8 
                     After bit toggling 262


Write a program to Bitclear the given number using in C language examples?

Bit clear,program to bit clear,C bit clear,bit clear the number,bit clear the given number,C program to bit clear,bit clear program in C,bit clear in C,Write a program to Bit clear the given number using in C language,C program to bit clear the given number


Bit clear the given number

      The below program is developed for Bit clear the number        
                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n&(~(1<<pos));

                            printf("After bit clear : %d\n",n);
                  }

    Output:
                     Enter numbers
                          7
                         
                     After bit clear3

Write a program to Bitset the given number using in C language examples?

Bit set,program to bit set,C bit set,bit set the number,bit set the given number,C program to bit set,bit set program in C,bit set in C,Write a program to Bit set the given number using in C language,C program to bit set the given number


Bit set the given number

 The program is clear about the bit set the number

                  #include<stdio.h>
                  main()
                  {
                           int n,pos;

                           printf("Enter numbers\n");
                           scanf("%d %d",&n,&pos);

                             n=n|(1<<pos);

                            printf("After bitset : %d\n",n);
                  }

    Output:
                     Enter numbers
                          6
                          3 
                     After bitset 14

Print the given number of in binary format using in C program language examples?

Binary format,C binary format,given number in binary format,print in binary format,binary format in C,Print the given number in binary format using in C program language,C program binary format,print in binary format,print the given number in binary,binary format of given number


Binary format of given number

    This one is for print the given number in binary format.
              
                #include<stdio.h>
                main()
                {
                      int n,pos;

                         printf("Enter number\n");
                         scanf("%d",&n);

                              for(pos=31;pos>=0;pos--)
                                 {
                                         if((n&(1<<pos))==0)
                                          printf("0");

                                          else
                                            printf("1");
                                  }
                }

       Output:-
                      Enter number
                             5
                       00000000000000000000000000000101

Write a program to find the given number is prime or not using in C language examples?

Prime number,find prime number,given number is prime or not,prime number in C,find the given number is prime or not,write a program to prime number,prime number program,Write a program to find the given number is prime or not using in C program language,C prime number,find C prime number


 Find the Prime number

         If a number is prime,it is divisible only with one(1) and itself(given number) is called Prime number.

                 #include<stdio.h>
                  main()
                  {
                        int n,i,c = 0;

                        printf("Enter number\n");
                        scanf("%d",&n);

                           for(i = 1; i <= n; i++ )
                             {
                                    if(n%i == 0)
                                     c++;
                              }
                         if(c == 2)
                         printf("It is Prime number\n");
                         else
                          printf("It is not a Prime number\n");
                   }

              Output:
                         1.  Enter number
                               7
                           It is a prime number

                        2. Enter number
                                 4
                             It is not a Prime number
      

Write a program to find the factorial of the given number using in C language examples?

Factorial program in C,find given number factorial,find the factorial of the given number,factorial C program,given number factorial,using C find the factorial of given number,Write a program to find the factorial of the given number using in C program language,using C find factorial,C factorial,find the factorial in C language

Factorial of given number

   The below program is for Factorial of the given number

                      #include<stdio.h>
                      main()
                      {
                           int n,fact = 1;

                            printf("Enter number\n");
                            scanf("%d",&n)
;
                               while(n>1)
                                 {
                                       fact = fact*n;
                                          n--;
                                  }
                               printf("Factorial of given number is %d\n",fact);
                       }

             Output:
                           Enter number
                                6
                           Factorial of given number is 720
                      

Reverse of the given number digits using in C program language examples?

Reverse the given number using in C program language,Reverse the number digits,reverse the given number,reverse the given number in C,reverse the given number using C language,reverse the given number in C program language,C reverse the number,reverse of the given number,C program reverse the given number,reverse of the given number in C


Reverse of the given number in C

       
      Program is developed at below for this logic.

                   #include<stdio.h>
                   main()
                   {
                           int n,rem,rev=0;

                                printf("Enter the number\n");
                                scanf("%d",&n);

                                  while(n>0)
                                  {
                                        rem = n%10;
                                        sum = (rev*10) + rem;
                                         n = n/10;
                                   }
                           printf("After reverse the numbers %d\n",sum);
                    }

              Output:-
                             
                                   Enter the number
                                       1234
                                    After reverse the number 4321
 

Sum of the given number digits using in C program language examples?

Sum of the given number,Sum of the given number in C,Sum of the given number in C program language,C language sum of the number,sum the number in C,Sum of the given number using in C program language,sum of the given number digits using C,using C sum the given number,C language sum program,sum of the number in C program language,sum the number


Sum of the given number in C:-


              Suppose we enter the number 1234,The sum of the 1234 is 1+2+3+4=10.
      Program is developed at below for this logic.

                   #include<stdio.h>
                   main()
                   {
                           int n,rem,sum=0;

                                printf("Enter the number\n");
                                scanf("%d",&n);

                                  while(n>0)
                                  {
                                        rem = n%10;
                                        sum = sum + rem;
                                         n = n/10;
                                   }
                           printf("After summing the numbers %d\n",sum);
                    }

              Output:-
                             
                                   Enter the number
                                       1234
                                    After summing the number 10
 

Write a program and explanation of the fibonacci series in C language examples?

Fibonacci series,explanation of the fibonacci series in C language,program and explanation of the fibonacci series in C language,Write a program and explanation of the fibonacci series in C language,Fibonacci series in C,fibonacci series in C language,C fibonacci series,C language fibonacci series,explain fibonacci series,fibonacci series C program

Fibonacci series:-

            Each number is the sum of two previous numbers.The below program is for the fabonacci series.

              Give the click to clear the fibonacci series.

fibonacci series

       
Program for Fabonacci series
          
                          #include<stdio.h>
                          main()
                          {
                                 int f,s,t;
                                 
                                   printf("Enter numbers\n");
                                   scanf("%d %d",&f,&s);
           
                                            do
                                                {
                                                      t = f+s;
                                                       printf("%d\n",t);
                                                       f = s;
                                                       s = t;
                                                 }while(t <= 50)
                           }

             Output: -
                                 Enter numbers
                                     0 1
                                 1 2 3 5 8 13 21 34 55
                    

Sunday 11 November 2012

Write a program to find the given number is Even or Odd using C language?

Find the given number is Even or Odd,find even or odd,given number is even or odd,Write a program to find the given number is Even or Odd,program to find Even or Odd,Even or odd in C,Write a program to find the given number is Even or Odd using C language,Even or Odd,C find given number is even or odd,number is even or odd

 Program to find Even or Odd

    The below program is to find the given number is Odd number or Even number.

            #include<stdio.h>
             main()
             {
                  int n;
                  
                     printf("Enter number\n");
                     scanf("%d",&n);
    
                         if(n%2 == 0)
                           printf("Given number is Even\n");

                          else
                            printf("Given number is Odd\n");

                
             }   

        Output:-
                       1.  Enter number
                              22
                          Given number is Even
                       2. Enter number
                                    22                          
                            Given number is Odd

write a program to find the ASCII value of the given character using C language?

Find the ASCII value of the given character,ASCII value of given character,given character ASCII value,character ASCII value,write a program to find the ASCII value of the given character,ASCII value of  character,find a character ASCII value

 Program to find the ASCII value

     This program is for to print the given character (A,B,C..........Z or a,b,c,d,........z) of ASCII value.
         
         #include<stdio.h>
         main()
         {
               char ch;

                 printf("Enter Character\n");
                 scanf("%c",&ch);

                    if((ch> = 'a') && (ch < = 'z') || (ch >=  'A') && (ch <= 'Z'))

                             printf("%d\n",ch);
          }

         Output:-
                            Enter character
                                  a
                                97
                         

write a program to swap the given two variables numbers without and with using third variable in C language?

Swap the given numbers,swap the numbers, without using third variable,swap the given two variables numbers  without using third variable,swap the given two numbers with using third variable,swap without third variable,swap with third variable,swap the two numbers,given two numbers are swap,swap the given two numbers without and with using third variable

Swap the given two variables without third variable

  The below program clear about the swapping the two variables without using the third variable.

          #include<stdio.h>
                 main()
                {
                        int a=5,b=10;

                              a = a+b;
                              b = a-b;
                              a =a-b;

                     printf("After swap the given number %d  %d\n",a,b);

                 }

        Output :-
                           a = 10, b = 5 

Swap the given two variables with third variable
        
      This program is clear the swapping the given variables with using the third variable.

                 #include<stdio.h>
                 main()
                {
                        int a=20,b=10,temp;

                              temp = a;
                              a = b;
                              b = temp;

                     printf("After swap the given number %d  %d\n",a,b);

                 }

        Output :-
                           a = 10, b =20
















    

Is it possible to write the C program without header file?

Is it possible to write the program without header file,Is it possible to write the C program without header file,write the program without header file,C program without header file,write the program without header file,C without header file,write the C program without header file,possible to write the C program without header file

 C program without header file

    Yes,It is possible because the file name is saved with ".c" extension (ahamad.c) it will be automatically included the header file.        .
         Eg:-     File name is ahamad.c
  
     Sample program:      
                                         main()
                                         {
                                              printf("Welcome to C");
                                          }
              The above program will compile and execute without header file because the file name is ahamad.c but don't forget to save with ".c" extension.

Saturday 10 November 2012

What are the Compilation steps in C language?

What are the Compilation steps in C,Compilation steps in C,C compilation steps,C language compilation steps,Compilation steps in C language,Compilation in C language

Compilation steps

        We will show the compilation steps in step by step through the clear picture.The figure shows the compilation steps are including in C.

C compilation

     If you want to clear about the compilation steps in C  click here
      
                    The above Figure shows the compilations steps in C

What is the C programming language?

What is C,What is the C programming language,What is C language,What is C programming,C language,C programming language,programming language C

C language


What is C language


       C is a general purpose programmaing language.It was developed by "Dennis Ritchie"  in 1972 at  bells laboratory.C is a procedural oriented programming.C is compiled language.It is one of the most widely using programming language.In 1972 it is used in UNIX operating system,after that it is slowly spread into all operating systems.