Mathematical Functions in SQL Server Questions and Answers

Read tutorials from Mathematical Functions in SQL Server


Question List:



Long Program Share

Program:

#include"stdio.h"
int main() {
   int side, area;
 
   printf("\nEnter the Length of Side : \n");
   scanf("%d", &side);
 
   area = side * side;
   printf("\nArea of Square : %d \n\n", area);
 
   return (0);
}

Output:


Enter the Length of Side :
6

Area of Square : 36

Press any key to continue . . .


Long Program Share

Program:

#include"stdio.h"
void main()
{ 
  float c,f; 
  printf("enter temp in centigrade: \n");
  scanf("%f",&c);
  f=(1.8*c)+32;
  printf("temp in Fahrenheit=%f \n",f);

}

Output:


enter temp in centigrade:
-40
temp in Fahrenheit=-40.000000
Press any key to continue . . .


Long Program Share

Program:

/**
 * C program to convert temperature from degree celsius to fahrenheit
 */ 
#include"stdio.h"
 
int main()
{
    float celsius, fahrenheit;
 
    // Reads temperature in celsius
    printf("Enter temperature in Celsius: ");
    scanf("%f", &celsius);
 
    // celsius to fahrenheit conversion formula
    fahrenheit = (celsius * 9 / 5) + 32;
 
    printf("%.2f Celsius = %.2f Fahrenheit \n", celsius, fahrenheit);
 
    return 0;
}

Output:


Enter temperature in Celsius: -40
-40.00 Celsius = -40.00 Fahrenheit
Press any key to continue . . .