Posts

Showing posts from January, 2022

PRIME NUMBER IN C LANGUAGE IS OR NOT

   #include<conio.h>  #include<iostream>  #include<stdio.h>    int main(){      int n,m,flag=0;       printf("\n Enter the number to know is it prime or not "); scanf("%d",&n); m=n/2;      if(n==0||n==1){          printf("\nNot a prime number ");          exit(0);                          }            else{          for(int i=2; i<=m;  i++){              if(n%i==0){                  printf("\n Not a prime number ");                  flag=1;                  break;              }          } ...

SNAKE GAME WITH GRAPHICS

  #include<iostream>   #include<conio.h>   #include<graphics>   #include<dos.h>   #include<stdlib.h>   #include<stdio.h>   #include<time.h>   #include<string.h>   class Snake   {    int p1,p2,v1,v2,v3,e1,e2,prev,now,n,colr,dsp,cnt,dly,m;    int stp, egGen;    int xr, yr;    void caught();    public:     long scr;    int strtX,strtY,endX,endY;    int pos[100][2];    void show();    void init();    void egg();    void transpose();    void gnrtCond();    void gnrtUnCond();    void check();    void checkEgg();    void move();    void chngDir();    void sndEt(); ...

FABONACCI SERIES BY LAKSHMAN

#include<conio.h> #include<stdio.h> int main(){ printf("Enter any number to know the fabonacci series of that number\n"); int number; scanf("%d",&number); int n1=0,n2=1,n3; print("%d %d",n1,n2); for(int i=1; i<number; i++){ n3=n1+n2; print("%d  ",n3); n1=n2; n2=n3;} }

FOR LOOP STATEMENT AS TOUGH:

  #include <stdio.h> #include <conio.h> void main ( void ) {   clrscr ();   int i = 5 ,j = 4 ;   if ( ! printf ( "" ))   printf ( " %d %d " ,i,j);   else   printf ( " %d %d " ,i ++ , ++ j);   getch (); }

pointer to function syntax and all

   #include <stdio.h> // function prototype and defination;  int *fun(int*p,int c){     *p=*p+c;     return p; }   int main() {   int*(*p)(int*,int ); int a=50;  int c=40;  p= fun; (*p)(&a,c); printf("%d",a);     return 0; }

F0R LOOP STATEMENT : for(; i++; printf("%d",i));

  #include<stdio.h> #include<conio.h> int main() { clrscr();      char i=0;       for(; i++; printf("%d",i));      printf("%d",i);           getch(); } answer  is : 1

FOR LOOP STATEMENT :

 #include<conio.h> #include<stdio.h> int main(){          int i=1; int j=1;           for(--i&&j++; i<10; i+=3){         printf(" loop = %d\t",i);     } } ans :   loop = 0 loop = 3 loop = 6 loop = 9

LENEAR SERACH IN C

 #include<stdio.h> #include<conio.h> void main(void) { clrscr(); int arr[5]={ 1,2,3,4,5}; int found =0; int ele; printf("Enter element for the fiinding \n:"); scanf("%d",&ele);   for(int i=0;i<6;i++) { if(arr[i]==ele){  printf("Element found at location %d ",i+1);  found =1; break; } } if(!found){  printf("\nElement not found "); }  getch(); }

SURPRISE GIFT FOR MY WEBSITE

                                THANK YOU FOR VISITING MY WEBSITE :

VISIT MY WEBSITE NOW

  WELCOME TO AGAIN IN MY BLOG: VISIT MY WEBSITE NOW: VISIT WEBSITE

LCSE IMAGE

Image
 HI GUYS THIS IS A 3D IMAGE :