Posts

ITVC Formula

Image

To calculate grade of students in python, you have to ask from user to enter marks obtained in 5 subjects and calculate the sum of all the marks and then average marks to find the grade according to the average marks obtained by student as shown in the given below

2)b))      To calculate grade of students in python, you have to ask from user to enter marks obtained in 5 subjects and calculate the sum of all the marks and then average marks to find the grade according to the average marks obtained by student as shown in the given below     sub1=int(input("Enter Marks Obtained In Subject 1:")) sub2=int(input("Enter Marks Obtained In Subject 2:")) sub3=int(input("Enter Marks Obtained In Subject 3:")) sub4=int(input("Enter Marks Obtained In Subject 4:")) sub5=int(input("Enter Marks Obtained In Subject 5:")) sum=(sub1+sub2+sub3+sub4+sub5) avg=sum/5 print("Total Marks is :",sum) print("Percentage :",avg) if (avg>=90):      print("O Grade") elif (90>avg>=80):      print("A+ Grade") elif(80>avg>=70):      print("A Grade") elif(70>avg>=60):      print("B+ Grade") elif(60>avg>=50):      print("B ...

Algothirm And Flow Chart Hand Written

 website Link :-  https://we.tl/t-gF8Ou8qNqi

Kth Largest number

  #include <stdio.h> int main() {    int size,i,j,k,temp;    printf("\nEnter size of array: ");    scanf("%d",&size);    //creating an array of size specified by user    int arr[size];    printf("\nEnter array values: ");    for(i=0;i<size;i++){        scanf("%d",&arr[i]);       }    printf("\nEnter k value: ");    scanf("%d",&k);    //Sorting in increasing order using bubble sort    for(i=0;i<size;i++){        for(j=0;j<size;j++){            if(arr[i]<arr[j]){                //swap arr[i] and arr[j]       ...

Reverse of a number

  # include <stdio.h> int main () { int n, reverse = 0 , remainder; printf ( "Enter an integer: " ); scanf ( "%d" , &n); while (n != 0 ) { remainder = n % 10 ; reverse = reverse * 10 + remainder; n /= 10 ; } printf ( "Reversed number = %d" , reverse); return 0 ; }

Maxium And Minimum of Three Numbers Using Terinary Operator

 #include<stdio.h> #include<conio.h> int main() {     int a,b,c,large,small;     printf("Enter a,b,c Values:");     scanf("%d%d%d",&a,&b,&c);     small=(a<b&&a<c)?a:(b<c)?b:c;     large=(a>b&&a>c)?a:(b>c)?b:c;     printf("Largest Of Three Numbers is %d \n",large);     printf("Smallest Of Three Numbers is %d",small);     return 0;     getch(); }

Student marks by using structures

Image
  #include <stdio.h> struct student { char name [ 30 ] ; int marks [ 5 ] ; int total; } ; int main () { struct student std; int i; printf ( "Enter name: " ) ; gets ( std. name ) ; printf ( "Enter marks:\n" ) ; std. total =0; for ( i=0;i < 5;i++ ){ printf ( "Marks in subject %d: " ,i+1 ) ; scanf ( "%d" ,&std. marks [ i ]) ; std. total +=std. marks [ i ] ; } return 0; } Result Write a C program to

Employe structure

  # include < stdio.h > /*structure declaration*/ struct employee { char name [ 30 ] ; int empId ; float salary ; } ; int main ( ) { /*declare structure variable*/ struct employee emp ; /*read employee details*/ printf ( " \n Enter details : \n " ) ; printf ( " Name ?: " ) ; gets ( emp . name ) ; printf ( " ID ?: " ) ; scanf ( " %d " , & emp . empId ) ; printf ( " Salary ?: " ) ; scanf ( " %f " , & emp . salary ) ; /*print employee details*/ printf ( " \n Entered detail is: " ) ; printf ( " Name: %s " , emp . name ) ; printf ( " Id: %d " , emp . empId ) ; printf ( " Salary: %f \n " , emp . salary ) ; return 0 ; } Output Enter details : Name ?:Mike I

Compute Mean Variance

  #include<stdio.h> #include<math.h> int main() { int i,n; float sum=0,sumsqr=0,mean,value,variance=0.0,a[100]; printf("Enter value of n : "); scanf("%d",&n); printf("\nEnter numbers : "); for(i=0;i<n;i++) { printf("\nNumber %d : ",i+1); scanf("%f",&a[i]); sum=sum+a[i]; } mean=sum/n; sumsqr=0; for(i=0;i<n;i++) { value=a[i]-mean; sumsqr=sumsqr+value*value; } variance=sumsqr/n; std_dev=sqrt(variance); printf("\nMean of %d numbers = %f\n",n,mean); printf("\nVariance of %d numbers = %f\n",n,variance); return 0; }

sum of numbers in malloc numbers

  #include<stdio.h>    #include<stdlib.h>    int  main(){      int  n,i,*ptr,sum=0;         printf( "Enter number of elements: " );         scanf( "%d" ,&n);         ptr=( int *)malloc(n* sizeof ( int ));         if (ptr==NULL)                              {             printf( "Sorry! unable to allocate memory" );             exit(0);         }         printf( "Enter elements of...

SUBTRACTION OF TWO COMPLEX NUMBERS

#include <stdio.h> struct complex { int r, i; } ; int main () { struct complex a, b, c; printf ( "Enter the value a and b of the first complex number (a + ib): " ) ; scanf ( "%d%d" , &a. r , &a. i ) ; printf ( "Enter the value c and d of the second complex number (c + id): " ) ; scanf ( "%d%d" , &b. r , &b. i ) ; c. r = a. r - b. r ; c. i = a. i - b. i ; if ( c. i > = 0 ) printf ( "Difference of the complex numbers = %d + %di" , c. r , c. i ) ; else printf ( "Difference of the complex numbers = %d %di" , c. r , c. i ) ; return 0; } Output: Enter the value a and b of the first complex number (a + ib): 2 3 Enter the value c and d of the second complex number (c + id): 4 5 Difference of the complex numbers = -2 -2i