program to accept a character in lowercase and convert it into uppercase

 /* write  a program to accept a character in lowercase and convert it into uppercase using  library function*/

#include<stdio.h>

#include<conio.h>

void main()

{            char ch;

              clrscr();

              printf(" \n Enter a character in lowercase :--");

              scanf("%c",&ch);

              ch=toupper(ch);

              printf(" \n  uppercase character = %c ",ch);

             getch();

}

/* output:--

                 Enter a character in lowercase :-- b

                 uppercase character  = B

*/

Algorithm of program

step 1: start

step 2: Declare ch

step 3: Accept character in lowercase

step 4: IS   ch=toupper(ch)

step 5:Display   uppercase character 

step 6:stop

                                                💬👇💗😊

Determine character is a capital, small case, digit or special symbol.. .


/* write a program to accept a character and check if it is capital letter, digit or special symbol using library function */

#include<stdio.h>

#include<conio.h>

#include<ctype.h>   /*is used to support character function */

void main()

{          char ch;

            printf(" \n \n Enter a character :-- ");

            scanf(" %c",&ch);

            if(isupper(ch))

                         printf(" \n %c is capital",ch);

            else if(islower(ch))

                         printf(" \n %c is small",ch);

            else if(isdigit(ch))

                        printf(" \n %c is Digit",ch);     

            else

                        printf(" \n %c is special symbol",ch); 

           getch();

}

/* output:--

                 Enter a character :-- *

                * is special symbol

                Enter a character :-- B

                B is capital

                Enter a character :-- 5

                5 is Digit

                Enter a character :-- a

                a is small

*/

                                                

                                                        👇💬💭💗😊

C program to check whether a character is alphabet, digit or special character

/*write a program to accept a number and check if it is capital letter , small letter ,digit or special symbol */

#include<stdio.h>

#include<conio.h>

void main()

{            char ch;

             printf(" \n Enter a character :-");

             scanf(" %c",&ch);

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

                        printf("\n %c is capital ",ch);

            else if( ch>=97 && ch<=122)

                         printf("\n %c is small ",ch);

            else if( ch>=48 && ch<=57)

                         printf("\n %c is Digit ",ch);

            else

                         printf("\n %c is special symbol ",ch);

            getch();

}

/* Output:--

                   Enter a character :- h

                   h is small

                   Enter a character :- 8

                   8 is Digit

                   Enter a character :- G

                   G is capital

                   Enter a character :- +

                   +  is special symbol

*/ 


                                                            👇💬💭😊👌

c program check whether a character is a vowel or not .

How do you check if a letter is a vowel in C,

 /* write a program to accept a character and check if it is vowel or not */

#include<stdio.h>

#include<conio.h>

void main()

{                char ch;

                 printf(\"n Enter a character in lower case : ");

                 scanf(" %c", &ch);

                 if(ch=='a' ||ch=='e'||ch=='i'||ch=='o'||ch=='u')

                 printf(" \n %c is a vowel ",ch);

                 else

                 printf(" \n %c is not a vowel ",ch);

}

/* Output:--

                 Enter a character in lower case : w

                 w is not  a vowel

*/


                        

https://www.programiz.com/c-programming/examples/vowel-consonant
                                                            

                                                                    👇💬💭😊

program to find out the largest no among three number using conditional and ternary operator

 

How do you find the largest of 3 numbers in C? ,What is conditional operator in C with example?The program output is also shown below. * C program to find the biggest of three numbers. int num1, num2, num3; printf("Enter the values of num1, num2 and num3\n"); scanf("%d %d %d", &num1, &num2, &num3); printf("num1 = %d\tnum2 = %d\tnum3 = %d\n", num1, num2, num3); if (num1 > num2) if (num1 > num3) More items...  C Program to Find the Biggest of 3 Numbers - Sanfoundrywww.sanfoundry.com › c-program-biggest-3-numbers,

 program to find out the largest no among three number using conditional and ternary operator */

#include<stdio.h>

#include<conio.h>

main()

{        int a,b,c;

         clrscr();

         printf(" \ n Enter the values for a, b and c =");

         scanf("%d%d%d",&a,&b,&c);

         (a>b)? (a<c)?printf("%d is largest",a): printf("%d is largest ",c):(b>c)?printf("%d is           largest",b):printf("%d is largest",c);

        getch();

}

/* Output :--

                    Enter the values for a, b and c =34

                                                                       89

                                                                       78

                    50 is largest

*/

                                        

https://forgetcode.com/c/1414-biggest-of-three-numbers-using-conditional-operator-ternary-operator

                                            💬💭👇👍😊

Conditional and Ternary operator ( ?, : )

 Conditional and Ternary operator ( ?, : )

Conditional and Ternary operator is used to check the condition at that place of it by using this operator we can  minimize the length of the program because true part and false part of condition is written in a single line.

Syntax 

(condition )? true part : false part 

Conditional or Ternary Operator (?:) in C/C++ - GeeksforGeeks

Examples:--

/*Program to find the largest no among two number using conditional and ternary operator  */

#include<stdio.h>

#include<conio.h>

main()

{        int a,b;

          clrscr();

          printf(" \n Enter the value for a and b = \n");

          scanf("%d%d",&a,&b);

          (a>b)?printf("%d is largest ",a) : printf("%d is largest ",b);

         getch();

}


/*    Output:--

                    Enter the value for a and b =20

                                                                  10

                    20 is largest

*/

         

 flowchart :--


       

                                                        💬💭😀👇

write a program to accept two number and find out the largest among them

two number largest,

 /*write a program to accept two number and find out the largest among them*/

#include<stdio.h>

#include<conio.h>

void main()

{                int a,b;

                 clrscr();

                 printf(" \n Enter two number =");

                 scanf("%d%d",&a,&b);

                if(a==b)

                      printf("\n Both are equal ");

                elseif(a>b)

                       printf("\n %dis largest ",a);

                else

                       printf("\n %dis largest ",b);

                getch();

}


/* Output :---

                   Enter two number =  20

                                                     30

                    20 is largest.

                    OR

                   Enter two number =  20

                                                     20

                   Both are equal

*/                                                                      👇😊💬💭👌

write a program to find out the largest among three number

 /* write a program to find out the largest among three number by use Nested if*/

#include<stdio.h>

#include<conio.h>

void main()

{                int a,b,c;

                  clrscr();

                  printf("\n Enter three number = ");

                  scanf("%d%d%d",&a,&b,&c);

                  if(a>b)

                   {     if(a>c)

                                          printf("%d is largest" ,a);

                          else

                                          printf("%d is largest" ,c);

                    }

                    else

                    {      if(b>c)

                                         printf("%d is largest" ,b);

                           else

                                         printf("%d is largest" ,c);   

                     }

                     getch();

}

/* Output :---

                 Enter three number = 56 

                                                    20

                                                      7

                   56 is largest .

*/




                                                                    👇💬💭😊👌

write a program to find the roots of the quadratic equation where the value of a, b, and c are entered by user

/* write a program to find the roots of the quadratic equation where the value of a, b, and c are entered by user*/

# include<stdio.h>

#include<conio.h>

void main()

{                float a,b,c,term,r1,r2;

                 printf("\n Enter the value for a,b and c =\n");

                 scanf("%f%f%f ",&a,&b,&c);

                 term= b*b-4*a*c;

                if(term<0)

                                printf( "\n Imaginary Roots ");

                elseif(term==0)

          {    printf("\n Roots are real and equal");

                r1= -b/(2*a);

                r2=r1;

                printf("\n r1=%f",r1);

                printf("\n r2=%f",r2);

          }

             elseif(term>0)

         {  printf("\n Roots are real and  and distinct")

             r1=(-b+sqrt(term))/(2*a);

             r2=(-b-sqrt(term))/(2*a)

            printf("\n r1=%f",r1);

            printf("\n r2=%f",r2);

         }

           getch();

}        

/*- output :--

                    Enter the value for a,b and c =1

                                                                     2

                                                                     3

                     Imaginary Roots

*/



                                   
                                                        👆😊💬💭

write a program to accept a number and check if it is odd or even


 /* write a program to accept a number and check if it is odd or even */

#include<stdio.h>

#include<conio.h>

void main()

{                int n;

                  clrscr();

                  printf("\n Enter a number = ");

                  scanf("%d%d",&n);

                  if(n/2==0)

                                printf("\n%d is Even",n);

                  eles

                                printf("\n %d is Odd",n)

                  getch();

}

/*Output :---

Enter a number = 4    Or    Enter a number = 5

Even                                   Odd

*/                                                                 

                                                                  👇💬😊💭              

find out the largest between 2 number


/* write a program to find out the largest between 2 number */

#include<stdio.h>

#include<conio.h>

void main()

{                  int a,b;

                    clrscr();

                    printf(" \n Enter two number = ");

                    scanf("%d%d",&a,&b);

                    if(a>b)

                                  printf("%d is largest ",a);

                   else

                                 printf("%d is largest ",b);

                   getch();

}

/*output:---

             Enter two number =10

                                             20

            20 is largest

*/


                                                                 👆👌😊😉

Decision Making (Using if )theory

 Decision Making Using if

1) keyword is a reserved word i.e a word which is already available in c language .there are 32 keywords available in c language.

2) if is a keyword is used to check condition and that basis we can take some decision , decision is based on whether the condition is true or false

syntax :

1) if  (condition)

                        true part;( i.e statement1)

2) if  (condition)

                        true part;( i.e statement1)

    else
                       false part; (i.e statement1)


3) if  (condition)
{                       statement 1;

                         statement 2;

                         statement 3;

}

    else

                         statement ;

4)  if  (condition)

{                       statement 1;

                         statement 2;

                                |

                                |

                         statement n;

}

    else

{                       statement 1;

                         statement 2;

                                |

                                |

                         statement n;

}

Example :--

/* program to find out the result pass or fail on the basis of marks of student where 35 and 35 above is pass*/

#include<stdio.h>

#include<conio.>

void main()

{                int marks;

                  clrscr();

                  printf(" \n Enter the your marks =" );

                  scanf("%d",&marks);

                  if(marks>=35)

                                        printf(" pass");

                  else

                                        printf(" fail ");

                  getch();

}


/* output :---

 Enter the your marks = 45

  pass

*/


                                                                 💬😊😉👌

write a program to accept value of a and b interchange the value of a and b i.e swapping

 /* write a program to accept value of  a and b interchange the value of a and b i.e swapping*/

#include<stdio.h>

#include< conio.h>


main()

{            

            int a,b,c;

            clrscr();

            printf("\n Enter a value of a and b:-- ");

            scanf("%d%d",&a,&b);

            c=a;

            a=b;

            b=c;

            printf(" \n The value of a is =%d",a);

            printf(" \n The value of b is=%d",b);

            getch();

}


/* Output

Enter a value of a and b:--34

                                         45

 The value of a is = 45

 The value of b is =34

*/


 Flowchart of  this program





                                                    💬😊😀














/* write a program to accept the marks for 3 subject of a student and calculate the total marks and percentage*/




/* write a program to accept the marks for 3 subject of a student and calculate the total marks and percentage*/

#include<stdio.h>

#include<conio.h>

main()

{

            int m,p,c;

            float Total ,per;

            printf("\n Enter marks of maths , physics, chemistry : );

            scanf("%d%d%d",&m,&p,&c );

            Total = m+p+c;

            percentage=total/300*100;

            printf("\n Total marks of the student is =%f ",Total);

            printf("\n  Total percentage of the student is =%f % ",per);

            getch();

}


*/output

Enter marks of maths , physics, chemistry :78,55,80

Total marks of the student is =210

Total percentage of the student is =70 %

*/                                                            

                                                                😊😉😮

                                                                      











                pe

7. PROGRAM TO CALCULATE GEOMETRIC MEAN FOR DISCRETE SERIES



/* 7. PROGRAM TO CALCULATE GEOMETRIC MEAN FOR DISCRETE SERIES*/

#include<stdio.h>

#include<math.h>

int main()

{

int x[]={1,2,3,4,5,6};

int f[]={5,9,12,17,14,10};

int i;

float lx[6],lf[6],gm=0,sl=0,n=0;

printf("\n COMPUTATION OF GEOMETRIC MEAN");

for(i=0;i<6;i++)

{

lx[i]=log(x[i]); /* Calculation of Log(X) */

lf[i]=lx[i]*f[i];/* Multiplication of Log(X)*Frequency */

n=n+f[i];        /* Addition of Frequency */

sl=sl+lf[i];     /* Addition of Log(X)*Frequency */

}

printf("\n\n\tX\tF\tLog(X)\t\tLog(X)*F\n\n");

for(i=0;i<6;i++)

printf("\n\t%d\t%d\t%f\t%f\n",x[i],f[i],lx[i],lf[i]);

gm=exp(sl/n);

printf("\n\n The Total Frequency Is:-%f",n);

printf("\n\n Sum of LOGX[i]*F[i] Is:-%f",sl);

printf("\n\nThe Geometric Mean Is:-%f",gm);

return 0;

}









/* OUTPUT:-

COMPUTATION OF GEOMETRIC MEAN


 X       F         Log(X)          Log(X)*F

 1       5         0.000000         0.000000 

 2       9         0.693147          6.238325           

 3       12       1.098612         13.183348  

 4       17       1.386294         23.567005  

 5       14       1.609438         22.532131      

 6       10       1.791759         17.917595         


 The Total Frequency Is:-67.000000   

 Sum of LOGX[i]*F[i] Is:-83.438408                  

 The Geometric Mean Is:-3.474148                                                                                                                                                                                                                                                                                                                         */


                                                      










/* 6. PROGRAM TO CALCULATE GEOMETRIC MEAN FOR INDIVIDUAL SERIES*/


/* 6. PROGRAM TO CALCULATE GEOMETRIC MEAN FOR INDIVIDUAL SERIES*/

#include<stdio.h>

#include<math.h>

int main()

{

int x[]={50,72,54,82,93};

int i;

float gm=0,sum=0,logx[5];

printf("\n COMPUTATION OF GEOMETRIC MEAN");

for(i=0;i<5;i++)

{

logx[i]=log(x[i]); /* Calculation of LogX*/

sum=sum+logx[i];   /* Addition of Log(X)*/

}

printf("\n\n\tX\tLOG(X)\n\n");

for(i=0;i<5;i++)

printf("\n\t%d\t%f\n",x[i],logx[i]);

gm=exp(sum/5);

printf("\nSum of LOGX is:-%f",sum);

printf("\nThe Geometric Mean Is:-%f",gm);

return 0;

}




/* OUTPUT:-

 COMPUTATION OF GEOMETRIC MEAN


         X       LOG(X)

        50      3.912023

        72      4.276666

        54      3.988984

        82      4.406719

        93      4.532599


Sum of LOGX is:-21.116993

The Geometric Mean Is:-68.265099

*/


                                                                〉》 👱😉😊〈《




                                                

c program, Advance coding, c++ program, simple program, Advance language

online quiz Application project page MCA final year project

  Here we making a quiz application ppt presentation for college project so that our project idea will like to our professor and teacher  fi...