Posts

Showing posts from August, 2021

*Some Important Campus Oriented Cases About "if" Statement.

 Some Important Campus Oriented Cases About "if" Statement. int x=10 , y=5 , z=7; 1. if(x>=y)       printf("Hello");            *O/P Hello 2. if (y>=z)        printf("Hello");            * NO  O/P  3. if(z==25)        printf("Hello");             *NO O/P 4. if(z=25)        printf("Hello");              *Will Assign In 'Z' Is Non Zero(T) O/P Hello 5. if(15)        printf("Hello");               *Will Assign In '15' Is Non Zero(T) O/P Hello 6. if(0)        printf("Hello");               *Will Assign In '0' Is  Zero(F) O/P NO 7. if(z=0)       printf("Hello");                *Will Assign In '...

//WAP TO CHECK ANY NO IS EVEN OR ODD.

 //WAP To Check Any No Is Even Or Odd. #include<stdio.h>  void main()     {         int no;         printf("\n Enter any no"):         scanf("%d" , &no);         if(no%2==0)             printf("\n no is even");         else              printf("\n no is odd");         }      OR #include<stdio.h>   void main()     {       int no;       printf("\n Enter any no");       scanf("%d" , &no);       if(no%2)          printf("\n no is odd");       else          printf("\n no is even");      }                  -SHAHRUKH KHAN(CSE)

//WAP TO FIND OUT BIGGEST NO FROM 3 NOS.

 //WAP To Find Out Biggest No From 3 Nos. #include<stdio.h> #include<conio.h> void main() {    int a, b, c;    printf("enter the value of a, b, c");    scanf("%d%d%d" , &a, &b, &c);    if(a>b && a>c)       printf("A is biggest");    else if(b>a && b>c)       printf("B is biggest");   else       printf("C is biggest);  }    Examples- a      b       c 12     5       7 5       12     7 7      5        12                             -SHAHRUKH KHAN(CSE)

ASCII VALUE-:

ASCII VALUE-: Its Full Form Is American Standard Code For Information Interchange. Dif.-: The Numeric Value Of Any Character Is Called ASCII Value. SOME ASCII VALUES-: A - 65  , B - 66 , C - 67 , D - 68 , E - 69 , F - 70 , G - 71 , H -72 , I -73 , J - 74 , K - 75 , L -76 , M -77 , N -78 , O -79 , P -80 , Q - 81 , R -82 , S -83 , T -84 , U -85 , V -86 , W -87 , X -88 , Y -89 , Z -90  a -97 , b -98 , c- 99 , d -100 , e -101 ,f -102 , g -103 , h -104 , i -105 ,j -106 , k -107 , l -108 , m -109 , n -110 , o -111 ,p -112 , q -113 , r- 114 , s -115 ,t -116 , u -117 , v -118 , w -119 , x -120 , y -121 , z -122 Space -32 , Backspac e-8, Ente r-13 , Esp -27 , Nul l-0                                                  -SHAHRUKH KHAN

//WAP TO CONVERT TEMPRATURE FROM FARENHEIT TO CENTIGRADE

 //WAP To Convert Temprature From Farenheit To Centigrade. #include<stdio.h> #include<conio.h>  void main()   {      float f , c;      clrscr();      printf("\n Enter Temp In Farenheit");      scanf("%f" , &f);     c=(f-32) / 1.8 ;     printf("\n Temp In Centigrade=%f" , c);     getch();  }

//WAP TO CALCULATE THE VALUES OF QUARDRATIC EQUITION

 //WAP To Calculate The Value Of Quardratic Eq. #include<stdio.h> #include<conio.h> #include<math.h>  void main()   {      int a , b , c;      clrscr();      printf("\n Enter a , b and c");      scanf("%d%d%d" , &a , &b , &c);      printf("\n x1=%f'" , (-b-sqrt(b*b-4*a*c))/(2*a));      printf("\n x2=%f'" , (-b-sqrt(b*b-4*a*c))/(2*a));      getch();  } 9

//WAP TO SWAPPING OF 2 INT NOS WITHOUT USING THIRD VERIABLE

 //WAP To Swapping Of 2 Int Nos Without Using Third Veriable #include<stdio.h>  void main()  {    int x , y;    printf("\n Enter The Value Of x, y");    scanf("\n %d%d , &x ,&y);    printf("\n Before Swapping %d%d" , x , y);    x=x+y;    y=x-y;    x=x-y;    printf("\n After Swapping , x , y);    }

//WAP TO CONVERT ANY UPPER CASE CHARACTER TO LOWER CASE

//WAP To Convert Any Upper Case Character To Lower Case Character  #include<stdio.h>  void main()  {    char ch;    printf("Enter Any Character In Upper Case");    scanf("%c" , &ch);    ch=ch+32;    printf("\n Lower Case Character=%c" , ch);  }

//WRITE A PROGRAME TO DISPLAY THE ASCII VALUE OF ANY CHARACTR;

//WAP To Display The ASCII Value Of  Any Character  #  include<stdio.h> #include<conio.h>  void main()     {        char ch;        clrscr();        printf("\n Enter Any Character ");        scanf("%c" , &ch);        printf("\n %c" , ch);        printf("\n ASCII Value =%d" , ch);        getch();     }