Posts

Showing posts from August, 2021

Write a python program to determine whether the character entered is a vowel or not.

Image
                                                      Write a python program to determine whether the character entered is a vowel or not. PROGRAM: c=input("Enter a character:") if (c=="=a" or c=="e" or c=="i" or c=="o" or c=="u"):     print(c, " is a vowel.") if (c=="A" or c=="E" or c=="I" or c=="O" or c=="U"):     print(c, "is a vowel.") else:     print(c,"is not a vowel.") OUTPUT: Enter a character: t t is not a vowel.

Write a python program to test whether a number entered by the user is negative, positive or equal to zero.

Image
                                Write a python program to test whether a number entered by the user is negative, positive or equal to zero. PROGRAM: num=int(input("Enter a number:")) if (num<0):     print(num, " is a negative.") elif (num>0):     print(num, "is a positive.") else:     print(num, "is equal to zero.") OUTPUT: Enter a number: -9 -9 is a negative.

C program to print the total mark and average mark of five subjects.

Image
  C PROGRAM C program to print the total mark and average mark of five subjects #include<stdio.h> int main() { struct student { int sub1,sub2,sub3,sub4,sub5,tot; float avg; }s; int n,i,a[n]; printf("Enter no. of students: "); scanf("%d",&n); for(i=0;i<n;i++) { printf("\nEnter the marks for student %d: \n",i+1); scanf("%d%d%d%d%d",&s.sub1,&s.sub2,&s.sub3,&s.sub4,&s.sub5); s.tot = s.sub1 + s.sub2 + s.sub3 + s.sub4 + s.sub5; s.avg =(s.sub1 + s.sub2 + s.sub3 + s.sub4 + s.sub5)/5.0;printf("\nThe total mark of student %d : %d",i+1,s.tot); printf("\nThe average mark of student %d : %.2f\n",i+1,s.avg); } return 0; OUTPUT: Enter no. of students: 2 Enter the marks for student 1:  90 89 94 96 97 The total mark of student 1 : 466 The average mark of student 1 : 93.20 Enter the marks for student 2:  89 90 99 96 95 The total mark of student 2 : 469 The average mark of student 2 : 93.80 Process finished. 

Write a C program to print the addition of the five values.

Image
  C PROGRAM Write a C program to print the addition of the five values #include <stdio.h> #include<conio.h> void main() {   int a[5],sum=0,i;   clrscr();   printf("enter five values");   for(i=0;i<=4;i++)   {     scanf("%d",&a[i]);   sum+=a[i];   }   printf("the sum of given numbers is %d",sum);   getch();   } OUTPUT: enter five values3 90 190 7937 2889 the sum of given numbers is 11109 Process finished.

The space between two square plate is 12.5mm with sides of 60cm. The movement of upper plate is 2.5m/s which force is 98.1N. Determine i)dynamic viscosity ii) kinematic viscostiy if the specific gravity of the oil is 0.95

Image
                                   The space between two square plate is 60cm with sides of 12.5mm. The movement of upper plate is 2.5m/s which force is 98.1N. Determine i)dynamic viscosity ii) kinematic viscostiy if the specific gravity of the oil is 0.95 . SOLUTION:

Two horizontal plates are placed 1.25 cm apart, the space between them being filled with oil of viscosity 14 poises. Calculate the shear stress in oil if upper plate is moved with a velocity of 2.5m/s.

Image
                                       Two horizontal plates are placed 1.25 cm apart, the space between them being filled with oil of viscosity 14 poises.  Calculate the shear stress in oil if upper plate is moved with a velocity of 2.5m/s. SOLUTION:

Calculate the dynamic viscosity of an oil, which is used for lubrication between a square plate of size 0.8m×0.8 m and an inclined plane with angle of inclination 30°. The weight of the square plate is 300N and its slides down on the inclined plane with a uniform velocity of 0.3m/s. The thickness of oil film is 1.5mm.

Image
                                     Calculate the dynamic viscosity of an oil, which is used for lubrication between a square plate of size 0.8m×0.8 m and an inclined plane with angle of inclination 30°. The weight of the square plate is 300N and its slides down on the inclined plane with a uniform velocity of 0.3m/s. The thickness of oil film is 1.5mm. SOLUTION:

Determine the intensity of shear of an oil having viscosity= 1 poise. The oil is used for lubricating the clearance between a shaft of diameter 10 cm and its journal bearing. The clearance is 1.5mm and the shaft rotates at 150 r.p.m.

Image
                                          Determine the intensity of shear of an oil having viscosity= 1 poise.  The oil is used for lubricating the clearance between a shaft of diameter 10 cm and its journal bearing.  The clearance is 1.5mm and the shaft rotates at 150 r.p.m.

A flat plate of area 1.5 × 10^6 mm^2 is pulled with a speed of 0.4 m/s relative to another plate located at a distance of 0.15mm from it. Find the force and power required to maintain this speed, if the fluid separating them is having viscosity as 1 poise.

Image
                                             A flat plate of area 1.5 × 10^6 mm^2 is pulled with a speed of 0.4 m/s relative to another plate located at a distance of 0.15mm from it. Find the force and power required to maintain this speed, if the fluid separating them is having viscosity as 1 poise. SOLUTION:

A plate 0.025 mm distant from a fixed plate, moves at 60 cm/s and requires a force of 2N per unit area(2 N/m^2) to maintain this speed. Determine the fluid viscosity between the plates.

Image
                                         A plate 0.025 mm distant from a fixed plate, moves at 60 cm/s and requires a force of 2N per unit area(2 N/m^2) to maintain this speed.  Determine the fluid viscosity between the plates. SOLUTION:

C program to calculate the sum of the pointer.

Image
  C PROGRAM C program to calculate the sum of the pointer #include<stdio.h> #include<string.h> void main() {     int*p,sum=0,i; int x[5]={5,9,6,3,8}; i=0;  p=x; clrscr(); printf("\nNOTATION VALUE ADDRESS \n\n"); while(i<5) { printf("x[%d] \t %d \t %u \n",i,*p,p);  sum=sum+*p; i++,p++; } printf("sum=%d",sum); getch(); } OUTPUT : NOTATION VALUE ADDRESS  x[0] 5 953465056  x[1] 9 953465060  x[2] 6 953465064  x[3] 3 953465068  x[4] 8 953465072  sum=31 Process finished.

C program to print the Fibonacci series.

Image
  C PROGRAM C program to print the  Fibonacci series #include<stdio.h> #include<conio.h> void main()  {     int n,first=0,second=1,next,a;     clrscr();     printf("enter the number of terms");     scanf("%d",&n);     for(a=0;a<n;a++)     {     if(a<=1)     {       next=a;       printf ("%d",next);       }       else       {       first=second;       second=next;       next=first+second;       printf("%d",first);       }       }       getch();       } OUTPUT :  enter the number of terms10 011123581321 Process finished.

C program to make a simple calculator.

Image
  C PROGRAM C program to make a simple calculator  #include <stdio.h> #include<conio.h> void main() {   float num1,num2,result;   char op;   clrscr();   printf("\n type your expression(num1,num2) \n");   scanf("%f%f",&num1,&num2);   printf("\n enter the operator[+,-,*,/] \n");   scanf("%s",&op);   switch(op)   {     case '+':       result=num1+num2;       break;       case '-':         result=num1-num2;         break;         case '*':           result=num1*num2;           break;           case '/':             if(num2==0)             {               printf("\n division by zero is error");           ...

C program to print the student address using the union concept.

Image
  C PROGRAM C program to print the student address the using union concept #include <stdio.h> #include<conio.h>  union student   {   char name[30];   int rollnumber;   char branch[10];   };   void main()   {   union student stud;   clrscr();   printf("\n enter name:\n");   scanf("%s",stud.name);   printf ("\n student name is:%s",stud.name);   printf ("\n enter rollnumber:\n");   scanf("%d",&stud.rollnumber);   printf ("\n student rollnumber is:%d",stud.rollnumber);   printf ("\n enter branch:\n");   scanf("%s",stud.branch);   printf ("\n student branch is:%s",stud.branch);   getch();   } OUTPUT : enter name: arunraj  student name is:arunraj  enter rollnumber: 20  student rollnumber is:20  enter branch: mechanical  student branch is:mechanical Process finished.

C program to print the number in ascending order.

Image
  C PROGRAM C program to print the number in ascending order #include <stdio.h> #include<conio.h> void main() {   int a[30],n,temp,i,j;   clrscr();   printf("enter the values of N \n");   scanf("%d",&n);   printf("enter the numbers \n");   for(i=0;i<n;i++)   {     scanf("%d",&a[i]);     }     for(i=0;i<n;i++)     {       for(j=i+1;j<n;j++)       {         if(a[i]>a[j])         {           temp=a[i];           a[i]=a[j];           a[j]=temp;           }           }           }           printf("the number is arranged in ascending order \n");           for(i=0;i<n;i++)           { ...

A company decides to give bonus to all its employees on Diwali. A 5% bonus on salary is given to the male workers and 10% bonus on salary to the female workers. Write a python program to enter the salary of the employees and sex of the employee. If the salary of the employee is less than Rs. 10,000 then the employees gets an extra 2% bonus on salary. Calculate the bonus that has to be given to the employee and display the salary that the employee will get.

Image
                                         A company decides to give bonus to all its employees on Diwali. A 5% bonus on salary is given to the male workers and 10% bonus on salary to the female workers. Write a python program to enter the salary of the employees and sex of the employee. If the salary of the employee is less than Rs. 10,000 then the employees gets an extra 2% bonus on salary. Calculate the bonus that has to be given to the employee and display the salary that the employee will get. PROGRAM:  a=int(input("Enter your salary:")) s=str(input("Enter your sex (Male/Female):")) print("************************************************************************") if (s=="Male"):     print("Your special salary due to diwali festival:"+"Rs.", a+(a*(5/100))) if (s=="Female"):     print("Your special salary due to diwali festival:"+"Rs.", a+(a*(10/100))) if (s...

Write a python program to enter any character. If the entered character is in lowercase then its convert into uppercase and vice versa.

Image
                                     Write a python program to enter any character. If the entered character is in lowercase then its convert into uppercase and vice versa. PROGRAM: a=input("Enter any character:") if (a.isupper()):     print("It is in uppercase. It's lowercase is",str.lower(a)) if (a.islower()):     print("It is in lowercase. It's uppercase is",str.upper(a)) OUTPUT: Enter any character: A It is in uppercase. It's lowercase is a Enter any character: g It is in lowercase. It's uppercase is G

Write a python program to increment a number if it is positive.

Image
                                   Write a python program to increment a number if it is positive. PROGRAM: a=int(input("Enter a number:")) if (a>0):     a=a+1     print("Number:",a) else:     print("Sorry! It's not a positive number.") OUTPUT: Enter a number: 5 Number: 6 Enter a number: -2 Sorry! It's not a positive number.

Write a python program to determine whether a person is eligible to vote.

Image
                                       Write a python program to determine whether a person is eligible to vote. PROGRAM: age=int(input("Enter your age:")) if (age>=18):     print("You are eligible to vote.") else:     print("Sorry! You are not eligible to vote.") OUTPUT: Enter your age: 18 You are eligible to vote.

C program to print the values in descending order.

Image
  C PROGRAM  C program to print the values in descending order #include <stdio.h> #include<conio.h> void main() {   int a[30],n,temp,i,j;   clrscr();   printf("enter the values of N \n");   scanf("%d",&n);   printf("enter the numbers \n");   for(i=0;i<n;i++)   {     scanf("%d",&a[i]);     }     for(i=0;i<n;i++)     {       for(j=i+1;j<n;j++)       {         if(a[i]<a[j])         {           temp=a[i];           a[i]=a[j];           a[j]=temp;           }           }           }           printf("the number is arranged in descending order \n");           for(i=0;i<n;i++)          ...

C program to swapping the two numbers using function concept.

Image
  C PROGRAM  C program to swapping the two numbers using function concept #include<stdio.h> #include<conio.h> void swap(int,int); void main() {   int x,y;   clrscr();   printf("enter the values of x and y:\n");   scanf("%d%d",&x,&y);   printf("\nbefore swapping values are:x=%d,y=%d",x,y);   swap(x,y);   getch();   }   void swap(int m,int n)   {     int temp;     temp=m;     m=n;     n=temp;     printf("\nafter swapping values are:m=%d,n=%d",m,n);     getch();    } OUTPUT : enter the values of x and y: 2  3 before swapping values are:x=2,y=3 after swapping values are:m=3,n=2 Process finished.

C program to calculate the matrix addition using a two dimensional array.

Image
  C PROGRAM  C program to calculate the matrix addition using a two-dimensional arra y #include <stdio.h> #include <conio.h> void main() {   int a[10][10],b[10][10],c[10][10],i,j,rows,columns;   printf("Enter the number of the rows");   scanf("%d",&rows);   printf("\n Enter the number of the columns");   scanf("%d",&columns);   printf(" Enter the elements of the first matrix \n");   for(i=0;i<rows;i++)   {     for(j=0;j<columns;j++)     {       scanf("%d",&a[i][j]);     }    }    printf(" Enter the elements of the second matrix \n");         for(i=0;i<rows;i++)   {     for(j=0;j<columns;j++)     {       scanf("%d",&b[i][j]);     }    }    printf("sum of two matrix is \n");    for(i=0;i<rows;i++)   {     for(j=0;j<co...

(D^2+D+1)y=sin(2x)

Image
  MATH (D^2+D+1)y=sin(2x)    

(D^2-3D+2)y=e^x

Image
  MATHS (D^2-3D+2)y=e^x

(D^2+2D+1)y=2x+x^2

Image
  MATHS (D^2+2D+1)y=2x+x^2

(D^2+3D+2)y=12x^2

Image
MATHS  (D^2+3D+2)y=12x^2

(D^2+3D+2)y=COS2x

Image
  MATHS (D^2+3D+2)y=COS2x