Showing posts with label Programming C. Show all posts
Showing posts with label Programming C. Show all posts

Pattern 01 // Right Triangle Star pattern // use VS code Application to code // Do Yo Know 'C' Programming Language ??? // Leave Comment YES or No

                                                                

         





 


SnakeMania - simple game

Score: 0
HiScore: 0


Right Triangle Star Pattern :

#include<stdio.h>
#include<conio.h>
void main ()
{
   int i,j;
   clrscr();
   for(i=1;i<=5;i++)
   {
       for(j=1;j<=i;j++)
       {
            printf("*");
        }
        printf("\n");
   }
   getch();
}


Output :

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


If  You Like my Blog Please Subscribe my You Tube Channel:
Allrounder SITA RAM SAHU

link


Also Follow my Blog I am Daily Post One Program On this Blog:
Allrounder SITA RAM SAHU

link


swapping using pointer program

 


Array to pointer program

 Instagram                              Twitter                        YouTube                 Facebook

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

--------------------------------------------------------------------------------------------------------------------

Question: Write a program to access element of an array by using pointers.

--------------------------------------------------------------------------------------------------------------------

credit this program coding_by_ak

Program:
                #include<stdio.h>
                #include<conio.h>
                void main (void)
                {
                     int *ptr;
                    int arr[10],i;
                    clrscr();
                    for (i=0; i<10; i++)
                    {
                        scanf("%d", &arr[i]);
                    }
                        ptr=&arr[0];
                        for (i=0; i<10; i++)
                        {
                            printf("%d\t", *(ptr+i));
                        }
                        getch();
                 }


{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

BCA,                    Programming C,                    Allrounder Sita Ram Sahu,            Blogspot.com

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

Recursion program

     Instagram                              Twitter                        YouTube                 Facebook

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

-----------------------------------------------------------------------------------------------------------------------------


-----------------------------------------------------------------------------------------------------------------------------

Question: Write a program to print a Fibonacci series using recursion up to 1000 numbers.

------------------------------------------------------------------------------------------------------------------------------

Credit this program Coding_by_ak

Program: 
                #include<stdio.h>
                #include<conio.h>
                long int rac(long int)
                void main (void)
                {
                    long int i;
                    clrscr();
                    for (i=1; i<=1000; i++)
                    {
                        printf("%ld\t, rac(i));
                    }
                    getch();
                }
                        long int rac(long int i)
                        {
                            if (i==0 || i==1)
                                return 1;
                           else 
                                return (rac(i-1)+rac(i-2));
                         }

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

BCA,                    Programming C,                    Allrounder Sita Ram Sahu,            Blogspot.com

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}