Convert decimal to hex c++ – C++ Program to Convert Decimal Number to HexaDecimal Number

Convert decimal to hex c++: In the previous article, we have discussed C++ Program to Convert Decimal Number to Octal Number. In this article, we will see C++ Program to Convert Decimal Number to HexaDecimal Number.

C++ Program to Convert Decimal Number to HexaDecimal Number

  • Write a C++ program to convert decimal to hexadecimal number.
  • Write a C++ program to convert hexadecimal to decimal number.

In this C++ programs we will learn about fundamentals of decimal and hexadecimal number system, how to convert decimal numbers to hexadecimal numbers and vice-versa. Given a decimal number we have to convert it to hexadecimal number.

Decimal number system is a base 10 number system using digits 0 and 9 whereas Hexadecimal number system is base 16 number system and using digits from 0 to 9 and A to F.
For Example:
2016 in Decimal is equivalent to 7E0 in Hexadecimal number system.

C++ program to convert decimal number to hexadecimal number

C++ program to convert decimal number to hexadecimal number

// C++ program to convert decimal numbers to hexadecimal numbers
#include <iostream>
#include <cstring>
using namespace std;
    
#define BASE_16 16
  
int main() {  
    char hexDigits[] = "0123456789ABCDEF"; 
    
    long decimal;  
    char hexadecimal[40];  
    int index, remaindar;  
        
    // Take a Decimal Number as input form user  
    cout << "Enter a Decimal Number\n";  
    cin >> decimal;   
    
    index = 0;
       
    // Convert Decimal Number to Hexadecimal Numbers 
    while(decimal != 0) { 
        remaindar = decimal % BASE_16;  
        hexadecimal[index] = hexDigits[remaindar];  
        decimal /= BASE_16;  
        index++;  
    }  
    hexadecimal[index] = '\0';  
    
    strrev(hexadecimal);  
    
    cout << "Hexadecimal Number : " << hexadecimal;  
    
    return 0;  
}

Output

Enter a Decimal Number
753
Hexadecimal Number : 2F1
Enter a Decimal Number
101
Hexadecimal Number : 3F2

In above program, we first declare a string hexDigits containing all digits of hexadecimal number system(0-9 and A-F). As hexadecimal numbers contains alphabets as digits, we have to use a character array to store hexadecimal numbers.

C++ program to convert hexadecimal number to decimal number

C++ program to convert hexadecimal number to decimal number

// C++ program to convert decimal numbers to hexadecimal numbers
#include <iostream>
#include <cstring>
#include <cmath>
using namespace std; 
    
int main() {  
    long long decimalNumber=0;
    // Digits of hexadecimal number system. From 0 to 9 and from A to F
    char hexDigits[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8',
      '9', 'A', 'B', 'C', 'D', 'E', 'F'};
    char hexadecimal[30];  
    int i, j, power=0, digit;  
    
    cout << "Enter a Hexadecimal Number\n";  
    cin >> hexadecimal;  
      
    // Converting hexadecimal number to decimal number
    for(i=strlen(hexadecimal)-1; i >= 0; i--) {
        // search currect character in hexDigits array
        for(j=0; j<16; j++){
            if(hexadecimal[i] == hexDigits[j]){
                decimalNumber += j*pow(16, power);
            }
        }
        power++;
    }  
   
    cout <<"Decimal Number : " << decimalNumber;  
    
    return 0;  
}

Output

Enter a Hexadecimal Number
2F1
Decimal Number : 753

Here is the list of C++ Program Example that are simple to understand and also you can use them to run on any kind of platforms easily.

Free c library – free C Library Function

free C Library Function

Free c library: The stdlib C Library function free deallocate a memory block which was previously allocated by a call to malloc, calloc or realloc. It makes deallocated block available for allocations.

Function prototype of free

void free(void *ptr);
  • ptr : This is a pointer to a memory block to deallocate, which was previously allocated with calloc, malloc or realloc. It does nothing, if ptr is null pointer.

Return value of free

NONE

C program using free function

Free function in c: The following program shows the use of free function to deallocate memory which was previously allocated using calloc.

free C Library Function

#include <stdio.h>
#include <stdlib.h>
 
int main(){
    int *array, counter, n, sum=0;
     
    printf("Enter number of elements\n");
    scanf("%d", &n);
     
    /* Allocate memory to store n integers using calloc */
    array = (int*)calloc(n, sizeof(int));
    /* 
     * Take n integers as input from user and store 
     * them in array 
     */
    printf("Enter %d numbers\n", n);
    for(counter = 0; counter < n; counter++){
        scanf("%d", &array[counter]);
    }
    /* Find sum of n numbers */
    for(counter = 0; counter < n; counter++){
        sum = sum + array[counter];
    }
    printf("Sum of %d numbers : %d", n, sum);
     
    /* Deallocate allocated memory */
    free(array);
     
    return 0;
}

Output

Enter number of elements
6
Enter 6 numbers
1 2 3 4 5 6
Sum of 6 numbers : 21

Fahrenheit to celsius c++ – C++ Program to Convert Fahrenheit to Celsius

Fahrenheit to celsius c++: In the previous article, we have discussed C++ Program to Convert Temperature from Celsius to Fahrenheit. In this article, we will see C++ Program to Convert Fahrenheit to Celsius.

C++ Program to Convert Fahrenheit to Celsius

  • Write a C++ program to convert temperature from fahrenheit to celsius degree.

In this C++ program to convert temperature from Fahrenheit to Celsius , we will take temperature in fahrenheit as input from user and convert to Celsius and print it on screen. To convert Fahrenheit to Celsius we will use following conversion expression:

C = (F – 32)*(5/9)
where, F is temperature in fahrenheit and C is temperature in celsius.

Points to Remember

  • Celsius is a temperature scale where 0 °C indicates the melting point of ice and 100 °C indicates the steam point of water.
  • Fahrenheit temperature scale was introduced around 300 years ago and is currently used in USA and some other countries. The boiling point of water is 212 °F and the freezing point of water is 32 °F.

C++ program to convert temperature from Fahrenheit to Celsius

C++ program to convert temperature from Fahrenheit to Celsius

// C++ program to convert temperature from fahrenheit to celcius
 
#include <iostream>
using namespace std;
  
int main() {
    float fahren, celsius;
  
    cout << "Enter the temperature in fahrenheit\n";
    cin >> fahren;
  
    // convert fahreneheit to celsius 
    // Subtract 32, then multiply it by 5, then divide by 9
     
    celsius = 5 * (fahren - 32) / 9;
  
    cout << fahren <<" Fahrenheit is equal to " << celsius <<" Centigrade";
      
    return 0;
}

Output

Enter the temperature in fahrenheit
80
80 Fahrenheit is equal to 26.6667 Centigrade

In above program, we first take fahrenheit temperature as input from user. Then convert it to celsius using above conversion equation and print it in screen.

Do you want to improve extra coding skills in C++ Programming language? Simply go with the C++ Basic Programs and start practicing with short and standard logics of the concepts.

C programming string to int – C Program to Convert String to Integer

C Program to Convert String to Integer
  • Write a c program to convert a string to integer.
  • How to convert a string to integer without using atoi function.

To convert string to integer, we first take a string as input from user using gets function. We have to convert this input string into integer. Input string should consist of digits(‘0’ to ‘9’) and minus sign(‘-‘) for negative numbers. It may contains some non-numerical characters like alphabet, but as soon as we see any non-numerical character we stop conversion and return converted integer till now.

For Example
Input String : “12345”
Output Integer : 12345

Input String : “-123abcd”
Output Integer : -123

C program to convert a string to integer using atoi function

atoi function is defined inside stdlib.h header file. Function atio converts the string parameter to an integer. If no valid conversion exist for that string then it returns zero. Here is the declaration for atoi() function.

int atoi(const char *str);

C Program to Convert String to Integer

/*
* C Program to convert string to integer using atoi
*/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
 
int main(){
    char inputString[20];
    printf("Enter a String for Integer conversion \n");
    gets(inputString);
 
    printf("Integer: %d \n", atoi(inputString));
    getch();
    return 0;
}

Program Output

Enter a String for Integer conversion 
2014
Integer: 2014
Enter a String for Integer conversion 
-2000abcd
Integer: -2000

C program to convert a string to integer without using atoi function

C programming string to int: In this program we convert a string to integer without using atoi function. We first check that inputString[0] is ‘-‘ or not to identify negative numbers. Then we convert each numerical character(‘0’ to ‘9’) to equivalent digit and appends it to converted integer. Then we multiply converted integer with -1 or 1 based upon whether input string contains negative or positive number. Finally, it prints the integer on screen using printf function.

C program to convert a string to integer without using atoi function

/*
* C Program to convert string to integer without using atoi
*/
#include <stdio.h>
#include <conio.h>
 
int main(){
    char inputString[20];
    int sign = 1, number = 0, index = 0;
    printf("Enter a String for Integer conversion \n");
    gets(inputString);
    /* Check for negative numbers */
    if(inputString[0] == '-'){
        sign = -1;
        index = 1;
    }
     
    while(inputString[index] != '\0'){
        if(inputString[index] >= '0' && inputString[index] <= '9'){
            number = number*10 + inputString[index] - '0';
        } else {
            break;
        }
        index++;
    }
    /* multiply number with sign to make it negative number if sign < 0*/
    number = number * sign;
    printf("String : %s \n", inputString);
    printf("Integer: %d \n", number);
    getch();
    return 0;
}

Program Output

Enter a String for Integer conversion 
-24356
String : -24356
Integer: -24356

Java program to convert celsius to fahrenheit – Java Program to Convert Celsius to Fahrenheit

Java program to convert celsius to fahrenheit: Practice Java programming from home without using any fancy software just by tapping on this Simple Java Programs for Beginners tutorial.

Java Program to Convert Celsius to Fahrenheit

  • Java program to convert temperature from Celsius to Fahrenheit.
  • Write a java program to convert temperature from Celsius to Fahrenheit.

In this java program, we have to convert celsius temperature to fahrenheit temperature scale. We will first take a celsius temperature as input from user and then convert it to fahrenheit temperature and print it on screen.

For Example,
40 Celsius is equal to 104 Fahrenheit

  • Celsius is a temperature scale where 0 °C indicates the melting point of ice and 100 °C indicates the steam point of water.
  • Fahrenheit temperature scale was introduced around 300 years ago and is currently used in US. The boiling point of water is 212 °F and the freezing point of water is 32 °F.

Given a temperature in celsius, we can convert to fahrenheit scale using following equation.

F =(9/5)*C + 32

where, C is the temperature in Celsius and F is temperature in Fahrenheit.

Java program to convert celsius to fahrenheit temperature

Java program to convert celsius to fahrenheit temperature

package com.tcc.java.programs;
 
import java.util.Scanner;
 
/**
 * Java Program to convert temperature from 
 * Celsius to Fahrenheit
 */
public class CelsiusToFahrenheit {
    public static void main(String args[]) {
        double celsius, fahren;
        Scanner scanner;
        scanner = new Scanner(System.in);
        // Take temperature in Celsius as input from user
        System.out.println("Enter Temperature in Celsius");
        celsius = scanner.nextFloat();
 
        fahren = (9.0 / 5.0) * celsius + 32;
 
        System.out.print("Temperature in Fahrenheit = " + fahren);
    }
}

Output

Enter Temperature in Celsius
100
Temperature in Fahrenheit = 212.0
Enter Temperature in Celsius
0
Temperature in Fahrenheit = 32.0

C++ prime number test – C++ Program to Check Prime Number

C++ prime number test: In the previous article, we have discussed C++ Program to check Whether a Number is Palindrome or Not. In this article, we will see C++ Program to Check Prime Number.

C++ Program to Check Prime Number

  • Write a C++ program to check whether a number is prime number or not.
  • How to test whether a number is prime number(Primality testing).

C++ Program to check Prime number

C++ Program to check Prime number

#include<iostream>
 
using namespace std;
 
int main() {
  int num, i, isPrime=0;
  cout << "Enter a Positive Integer\n";
  cin >> num;
  // Check whether num is divisible by any number between 2 to (num/2)
  for(i = 2; i <=(num/2); ++i) {
      if(num%i==0) {
          isPrime=1;
          break;
      }
  }
    
  if(isPrime==0)
      cout << num << " is a Prime Number";
  else
      cout << num << " is not a Prime Number";
        
  return 0;
}

Output

Enter a Positive Integer
23
23 is a Prime Number
Enter a Positive Integer
21
21 is not a Prime Number

Know the collection of various Basic C++ Programs for Beginners here. So that you can attend interviews with more confidence.

Fluid mechanics notes for mechanical engineering – Fluid Mechanics Notes and Study Material PDF Free Download

fluid-mechanics-notes

Fluid Mechanics Lecture Notes PDF: Engineering students pursuing their Mechanical or Civil engineering or students applying for GATE can get a grip on the Fluid Mechanics course & other sources of reference from this article. Students can access the best & most credible sources of notes on Fluid Mechanics to enhance & better their preparation or revision process of essential concepts.

The article on Notes of Fluid Mechanics acts as the principal & ultimate preparation tool that fosters and enhances better preparation and helps students secure good grades. Students can download the pdf formats for free and refer to the Fluid Mechanics Lecture Notes as per the latest & up-to-date curriculum from here.

The B.Tech Fluid Motion Mechanics Notes give candidates a head start as they will also acquire the latest, updated, and comprehensive notes in pdf format, updated syllabus structure, subject expert-recommended reference books, and all the important questions on Fluid Mechanics Lecture Notes over regular class notes.

Participants can avail the Fluid Mechanics Hand Written Notes Pdf along with the list of reference books and important questions from this article & better preparation methods and apply strategies during the examination to achieve better grades.

Introduction to Fluid Mechanics Complete Notes

Fluid mechanics notes for mechanical engineering: Mechanics is the oldest branch of physical science that deals with moving & stationary bodies under the influence of external or internal forces. Introduction to Fluid Mechanics consists of simple concepts through suitable day-to-day examples in connection through mathematics.

fluid mechanics study notes pdf

This branch of mechanics deals with statics while the branch of dynamics deals with motion. Fluid Mechanics is defined as the branch of physics or engineering that analyzes the behaviour of fluids at static or in motion. It even analyzes the interaction of fluids with other fluids or solids at boundary levels. The concept of Fluid Mechanics enlists various theories of flow that can be applied or connected to real phenomena and can draw simplification through illustrations with numerous figures & photographs.

Besides experiments, theoretical considerations, & simulations used heavily in research, the most accurate, practical, and productive approach for Fluid Mechanics is the combination of all three methods.

B.Tech Fluid Mechanics PDF Free Download Notes & Study Materials

Students pursuing their Bachelor’s in Technology (B.Tech), Mechanical Engineering, or Civil Engineering can access the best and credible sources of reference from the Fluid Mechanics Free PDF Notes briefed in this article. Students can enhance & better their preparation with the ultimate preparation tools and secure better marks.

Candidates can access and download the notes free pdfs & refer to them whenever during the preparation or revision process. The frequent utilization of Notes Fluid Mechanics as a source of reference will help candidates get a better hunch of all the important concepts &  change their score game.

Here, are a list of a few credible and important Fluid Mechanics Lecture Notes for a thorough preparation of B.E or B.Tech course programme-

  • Fluid Mechanics Lecture Notes for Mechanical Engineering Pdf
  • Fluid Mechanics Hand Written Notes Pdf
  • Fluid Mechanics Handwritten Notes Free Pdfs
  • Fluid Motion Mechanics Notes for GATE Pdf
  • Fluid Mechanics lecture Notes Pdfs.
  • Fluid Mechanics Programme Past Year’s Question Paper Pdfs
  • Chapter-wise Fluid Dynamics Mechanics Lecture Notes Pdfs
  • Fluid Mechanics PDF Notes for Civil Engineering Pdf

Reference Books of the Fluid Dynamics Mechanics

Textbooks and Reference Books are a rich source of information and well-researched data that guide and teach students of all the important topics enlisted in the curriculum of Fluid Mechanics topics Candidates should ensure to consult books that offer them excellent conceptual background.

The article on Notes Fluid Motion Mechanics enlists the best textbooks and reference books on Fluid Mechanics as per the subject experts’ recommendations. Students can refer & read through the Fluid Mechanics boundary layer theory textbooks & reference books during their preparation.

The list of best and highly influential books for Fluid Mechanics preparation are as follows, & candidates can select the book that meets their knowledge and prepare accordingly.

  1. Fluid Mechanics by Modi and Seth
  2. Fluid Mechanics by Dr A. K. Jain
  3. Fluid Mechanics by J.F.Douglas, J.M. Gaserek, and J.A. Swaffirld
  4. Introduction to Fluid Machines by S.K.Som and G.Biswas
  5. Fluid Mechanics by Streeter and Wylie
  6. Open Channel Flow by K. G. RangaRaju
  7. Fluid Mechanics- Fundamentals and Applications by Yunus Cengel and Jhon Cimbala
  8. Fluid Mechanics by A.K. Mohanty
  9. Introduction to Fluid Machines by Edward J. Shaughnessy Jr, Ira M. Katz, and James P. Schaffer
  10. A text of Fluid mechanics and hydraulic machines by Dr R.K. Bansal
  11. Fluid Mechanics by Frank. M. White
  12. Fluid Mechanics and Hydraulic Machines
  13. Engineering Fluid Mechanics by R. J. Garde and A.J Mirajgaonkar
  14. Fluid Mechanics by K. Subramanya
  15. Open Channel Flow by M. M. Das

PDF Notes Fluid Mechanics Syllabus & Curriculum

The syllabus is the best course planning tool that can make your preparation effective through a thorough organization, structure, and planning of contents in the Fluid Mechanics course programme. The Fluid Mechanics syllabus provides students with an initial idea and a basic outline of important topics or concepts. The article on Fluid Dynamics Mechanics PDF Notes provides a detailed view of the course curriculum, taking into consideration every student’s requirements and needs.

The Fluid Mechanics course syllabus gives students a clear idea of what to study and how to study. Students can access the unit-wise division of all the important topics that fall under each unit and allot time to each topic and prepare accordingly.

Students should ensure to cover all the important topics before attempting to be in the Fluid Mechanics exam so that the paper is easy and answerable during the exam. Candidates should remain aware of an entire Fluid Mechanics Syllabus to prevent wasting unnecessary time on redundant topics.

The updated unit-wise division of all the important topics listed in the Fluid Mechanics Syllabus is as follows-

Unit Topics
UNIT-I
  • Introduction- Differences between fluid and solid, Differences between gas and liquid
  • Types of Fluid- Newtonian and non-Newtonian fluids, Compressible and incompressible fluids
  • Physical Properties- Viscosity, Vapor pressure, Compressibility and Bulkmodulus, Surface tension, Capillarity Problems -SurfaceTension
  • Fluid Statics- Pascal’s law for pressure at a point in a fluid, Variation of pressure in a Static fluid, Absolute and gauge pressure, and vacuum
  • Pressure Management- Fluid Pressure, Barometers, Piezometers, Manometers, and Pressure Gauges- Bourdon gauge
  • Buoyancy – principles
  • Units and Dimensions
  • Similitude and model studies
UNIT-II
  • Fluid Flow- Streamline, Stream tube
  • Steady and Uniform flow, One-dimensional and multidimensional flow, Equation of continuity, Energy equation – Bernoulli’s equation, Momentum equation, Torricelli equation, Trajectory of a liquid-jet issued upwards in the atmosphere, Trajectory of a jet issued from an orifice at the side of a tank, Water Hammer, Laminar and Turbulent flow
  • Boundary-Layer Concept- Introduction, Development of boundary layer for flow over a flat plate, Development of boundary layer for flow through the circular pipe, Entry length, Fully developed flow, Boundary layer separation
  • The flow of incompressible fluid in pipes- Laminar flow, Hagen Poiseuille equation, Friction factor, the Pressure drop in turbulent flow, Velocity Distribution for turbulent flow, Surface roughness, Flow-through non-circular pipes, Flow-through curved pipes, Expansion losses, Contraction losses, Losses for flow-through fittings, Equivalent length of pipe fittings
  • Types of flow problems
  • Compressible fluid flow- Equations of compressible flow, Velocity of sound in the fluid, Mach number, Nozzles, and diffusers, Maximum velocity
  • Two Dimensional Flow- Velocity potential, Potential function, Irrotational flow
UNIT-III
  • Closed channel flow measurement- Venturi meter, Orifice meter, Venturi – Orifice Comparison, Pitot tube, Rotameter, Flow measurement based on Doppler effect, Hotwire and hot film anemometer, Magnetic flow meter
  • Open channel flow measurement- Elementary theory of weirs and notches, Rectangular notch, V-notch, Suppressed and contracted weirs, Submerged weirs, Trapezoidal notch
UNIT-IV
  • Flow past immersed bodies- Form drag, Wall drag, Drag coefficients
  • Friction in the flow-through bed of solids- Blake-Kozeny Equation, Burke-Plummer Equation, Ergun equation
  • Packed Towers- Applications, Various types of packing, Requirements for good packing, Loading and Flooding
  • Fluidization- Minimum fluidizing velocity, Pressure Drop in Fluidized bed, Fluidization Types
  • The motion of a particle through fluid
  • Terminal settling velocity
  • Operating ranges of fluidization
  • Applications of fluidization
  • Pneumatic transport
UNIT-V
  • Transportation of fluids- Pump classifications, Suction, discharge, net pressure heads, specific speed and power calculations, and NPSH
  • Characteristics and constructional details of centrifugal pumps- Cavitation, and Priming
  • Positive displacement pumps- Piston pumps – single and double-acting, Plunger pumps, Diaphragm pump
  • Rotary pumps- Gear pumps, Lobe pumps, Screw pumps
  • Airlift pump
  • Jet pump
  • Selection of pumps
  • Fans, blowers, and compressors

List of Fluid Mechanics Important Questions

Candidates pursuing Mechanical Engineering can read through and practice the list of all the essential questions enumerated below for the Fluid Mechanics course programme. All the review questions enlisted below aim to help each candidate to excel in the examination and secure better grades.

  1. State Newton’s Law of Viscosity with suitable examples.
  2. Define the terminologies- Vapour Pressure and Surface Tension.
  3. State the classification of the types of liquids.
  4. Derive Bernoulli’s equation for flow along a streamline and enumerate the assumptions.
  5. With a neat-labelled illustration, explain the various elements of a Hydropower Plant.
  6. Briefly explain the calculation process of pressure using differential manometers.
  7. Solve the numerical- Determine the extend force by a jet on the work done and the plate, when the jet of water 50 mm in diameter issues and with a velocity of 10m/sec and normally impinges on a stationary flat plate which moves in forward motion.
  8. Define mass Density and state its unit measurement.
  9. Write short notes on the centrifugal and reciprocating pump.
  10. Briefly explain Kinematic Viscosity with suitable examples.

FAQs on Fluid Mechanics Lecture Notes

Question 1.

Define Fluid Dynamics Mechanics with common applications.

Answer:

Fluid Mechanics is the branch of mechanics that deals with the various properties of liquids and gases but, essentially it is the study of fluids either in motion- known as fluid in dynamic mode or at static- known as fluid in static mode.

Applications: A few most common applications of Fluid Mechanics are Hydroelectric Power Plants, Hydraulic machines, Automobiles, Heat Engines, etc.

Question 2.

What are the advantages of Fluid Dynamics Mechanics Lecture Notes Pdfs?

Answer:

Fluid Motion Mechanics Notes Pdf provides the best and credible sources of reference that enhance and better students’ preparation. These pdfs act as the ultimate preparation tools and help students strategize their methods or approaches and secure better marks.

Candidates can download the pdf for free and refer to them whenever during the preparation or revision process. The frequent utilization of the Fluid Dynamics Mechanics Lecture Notes pdfs as a source of reference will help candidates get a better hunch of all the important concepts and change their score game.

Question 3.

How is the Fluid Mechanics syllabus different from reference materials?

Answer:

The Fluid Mechanics syllabus acts as the best course planning tool that can make student’s preparation effective through a thorough organization, structure, and planning approaches. The Fluid Mechanics syllabus provides students with an initial idea and a basic outline of the important topics or concepts and provides a detailed view of the course curriculum.

The Fluid Mechanics course syllabus gives students a clear idea of what to study and how to study, and the unit-wise division of all the important topics that fall under each unit help students allot time to each topic and prepare accordingly.

Question 4.

State four probable questions on Fluid Mechanics

Answer:

  • State Newton’s Law of Viscosity with suitable examples.
  • Define the terminologies- Vapour Pressure and Surface Tension.
  • State the classification of the types of liquids.
  • Derive Bernoulli’s equation for flow along a streamline and enumerate the assumptions.

Conclusion on Books & Notes of Fluid Mechanics

The article on Notes Fluid Mechanics aims to help students get hold of accredited and accurate sources of study materials. The list of all the important notes, study materials, reference books, and important questions listed above foster to help students enhance and better their knowledge and comprehension of the topics- notes Fluid Mechanics during their preparation or revision practice and at the time of examination.

Students should stay updated and make much use of all the important notes fluid mechanics and study material pdf, reference sources like textbooks and updated curriculum and practice from the Fluid Mechanics important question enlisted in this article.

Calculator using switch case in python – C++ Program to Make a Simple Calculator Using Switch Case Statement

Calculator using switch case in python: In the previous article, we have discussed C++ Program to Check Leap Year. In this article, we will see C++ Program to Make a Simple Calculator Using Switch Case Statement.

C++ Program to Make a Simple Calculator Using Switch Case Statement

  • Write a C++ program to make a simple calculator for addition, subtraction, multiplication and division using switch case statement.

In this C++ Program, we will make a simple calculator using switch case statement to perform basic arithmetic operations like Addition, Subtraction, Multiplication and Division of two numbers. Before jumping into program, we need a basic understanding of arithmetic operators of C++.

An arithmetic operator is a symbol used to perform mathematical operations in a C++ program. The four fundamental arithmetic operators supported by C++ language are addition(+), subtraction(-), division(/) and multiplication(*) of two numbers.

Operator Description Syntax Example
+ Adds two numbers a + b 15 + 5 = 20
Subtracts two numbers a – b 15 – 5 = 10
* Multiplies two numbers a * b 15 * 5 = 75
/ Divides numerator by denominator a / b 15 / 5 = 3

C++ Program to Make a Simple Calculator using Switch Case Statement

C++ Program to Make a Simple Calculator using Switch Case Statement

// C++ program to make a simple calculator to Add, Subtract, 
// Multiply or Divide using switch...case statement
#include <iostream>
using namespace std;
  
int main() {
    char op;
    float num1, num2;
      
    cout << "Enter an arithemetic operator(+ - * /)\n";
    cin >> op;
    cout << "Enter two numbers as operands\n";
    cin >> num1 >> num2;
  
    switch(op) {
        case '+': 
                cout << num1 << " + " << num2 << " = " << num1+num2;
                break;
        case '-':
                cout << num1 << " - " << num2 << " = " << num1+num2;
                break;
        case '*':
                cout << num1 << " * " << num2 << " = " << num1*num2;
                break;
        case '/':
                cout << num1 << " / " << num2 << " = " << num1/num2;
                break;
        default: 
                printf("ERROR: Unsupported Operation");
    }
      
    return 0;
}

Output

Enter an arithemetic operator(+ - * /)
+
Enter two numbers as operands
2 8
2 + 8 = 10
Enter an arithemetic operator(+ - * /)
*
Enter two numbers as operands
3 7
3 * 7 = 21

In above program, we first take an arithmetic operator as input from user and store it in a character variable op. Our calculator program only support four basic arithmetic operators, Addition(+), Subtraction(-), Multiplication(*) and Division(/). Then we take two integers operands as input from user and store it in variable num1 and num2.

We are using switch case statement for selecting appropriate arithmetic operation. Based on the operator entered by the user(+, -, * or /), we perform corresponding calculation and print the result on screen using cout.

If the arithmetic operator entered by the user doesn’t match with ‘+’, ‘-‘, ‘*’ or ‘/’ then default case block will print an error message on screen.

We know that C++ is an object oriented programming language. The advanced C++ Topics are enumerated constants, multi-dimensional arrays, character arrays, structures, reading and writing files and many more. Check the complete details of all those from this article.

Aerospace engineering notes – Aerospace Engineering Notes, Course Details, Duration, Eligibility, Admissions, Fee, Career Prospects

Aerospace Engineering Notes

Aerospace engineering notes: Aerospace Engineering is one of the most popular branches of Engineering for the students of graduation and post-graduation. The entire course provides the student with immense skills and knowledge for designing, manufacturing, and maintaining the aircraft, spacecraft, weapons, and missiles.

Aerospace Engineering also contains several concepts of mechanical Engineering. It covers a more comprehensive range of concepts of physics, mathematics, computer applications and structure, robotics, electricity, drafting, aeronautics, and many more. Additionally, the courses also cover the two vital matters of Engineering, which are, Astronomical Engineering and Aeronautical Engineering.

The course is one of the most challenging branches of the Engineering courses and is also widely popular among the worldwide engineering aspirants.

Aerospace Engineering Notes and Syllabus

First Year:
  • Professional Communication
  • Environmental Studies
  • Mechanical Engineering fundamentals
  • Engineering Mathematics -1
  • Engineering Mathematics -2
  • Engineering Physics
  • Technical Communication
  • Electrical Engineering fundamentals
  • Engineering Chemistry
  • Electronics Engineering fundamentals
  • Computer Fundamentals
  • Engineering Drawing
Second Year:
  • Engineering Mathematics – 3
  • Aerospace Engineering introduction
  • Thermodynamics and Aero Engineering
  • Control Engineering
  • Aerospace Structures – 1
  • Fluid Mechanics & Machinery
  • Aerodynamics -1
  • Propulsion -1
  • Solid Mechanics
  • Elements of Avionics
  • Numerical Methods
  • Environmental Science & Engineering
Third Year:
  • Flight Mechanics -1
  • Flight Mechanics – 2
  • Aerospace Structures – 2
  • Propulsion – 2
  • Propulsion -3
  • Aerodynamics – 2
  • Aircraft Maintenance Practices
  • Advanced Materials and performance
  • Vibration elements
  • Electives
Fourth Year:
  • Flight Mechanics – 3
  • Missiles and rockets
  • Total quantity management
  • Professional ethics
  • Space system and satellite design
  • Composite materials and structure introduction
  • Electives
  • Major Project

Avail subject-wise B.Tech Notes related to Engineering Departments like ECE, CSE, Mech, EEE, Civil, etc. all in one place at BTech Geeks and plan your preparation according to your requirements.

Required Skillsets to study Aerospace Engineering:

Aerospace Engineering is a specialized branch of the Engineering curriculum, and it involves several high-tech concepts, requiring immense knowledge in observation skills, calculative skills, and mathematics. Experts of the field need tremendous experience for the research based on the concepts of Aerospace Engineering; thus, for the candidates, the two essential skills are persistence and resilience.

To be a successful aerospace Engineer, not just these, but many other skill sets are essential. Here is a list of all the skills necessary for the students of Aerospace Engineering:

  1. A great academic history from Science stream.
  2. Stronger mathematical and analytical skills.
  3. Immense creativity.
  4. More innovativeness in the concepts of product designing.
  5. Capability to handle higher pressure and work under the same
  6. Better stamina
  7. Team working abilities
  8. Skills to be a leader of the team.

Eligibility Criteria for Aerospace Engineering:

There are some minimum eligibility criteria that every Aerospace Engineering aspirant must meet for pursuing the course.

B.Tech/ BE:

For pursuing BE/ B.Tech from Aerospace Engineering, the students have qualified Class 12th or higher secondary with 60% or above for general category and 55% or above for SC/ ST in Science.

M.Tech/ ME:

Aerospace Engineering is also there for the postgraduate degree of ME/ M.Tech; for this, the student must have completed Bachelors or any equivalent degree with 60%+ for general category and 55%+ for SC/ST. Additionally, the GATE scores are also important for getting admission in postgraduate or doctorate programs.

Admission Process for Aerospace Engineering:

For taking admission in Aerospace Engineering, the students must go for either of the below-mentioned options.

Admission based on entrance test:

For this method, the candidates must appear in any of the entrance examinations, including JEE Main/ Advance, CET, MHT, and others. Based on the performance of the students in the entrance exams, the top institutes prepare a merit list and then start with conducting the counselling rounds for finally allocating the seats. The students can go for any level of the entrance exam, including the state level, national level, and institute level, to qualify for the admissions.

Direct admissions:

Through this method, the students can apply for the admissions directly for any program using the official portal of the institute. The candidates must also fulfil the eligibility criteria mentioned above to take admission in the course, and then they can pay the admission fee to secure their seat.

Job Profiles for Aerospace Engineers:

Aerospace Engineers perform the designing of weapon systems, missiles, aircraft, and spacecraft. Additionally, they are responsible for the assembling and maintenance of the systems and ensuring that they function correctly and effectively. Many Aerospace Engineers also have specialization in propulsions, guidance control, air guidance, and others.

There are many responsibilities of Aerospace Engineers, as mentioned below:

  • Developing newer technologies for using in aviation, defence systems, and spacecraft.
  • Design, assembling, and test for the aerospace and aircraft products.
  • Examining the damage and malfunctioning in any equipment for finding the reasons behind them and then offering the right solution.
  • Finding out the cost and feasibility of newer project proposals.
  • Determining the quality standards and acceptance criteria for the designs and maintain the sustainment after delivery and completion dates.
  • Evaluating that the product or project meets the engineering principles, customer requirements, safety norms, and environmental challenges.
  • Manufacturing the entire aircraft and its components with the designing team.

Aerospace Engineers can also have specialization in Aeronautical or astronomical Engineering. Aeronautical Engineers works on the components of aircraft and the Astronomical Engineers work on the technologies related to spacecraft.

Aerospace Engineering Jobs:

Currently, Aerospace Engineers hold around 66,400 jobs in all and the largest employees of the field are as follows:

  1. Manufacturing of Aerospace products and parts – 36%
  2. Federal Government posts – 16%
  3. Engineering services – 15%
  4. Manufacturing of measuring, navigation, control, and electromedical instruments – 10%
  5. R&D in Engineering, physical, and life sciences – 8%

Aerospace Engineers get employed in the industries where workers do the designing and manufacturing of missiles, aircraft, and other systems for the defence system of the nation. They mainly work for the firms engaging in R&D, manufacturing, design and analysis, and also for the streams of the federal government.

Presently, most of the aerospace Engineers spend their time in the office environment as the modern techniques of aerospace designing needs using the sophisticated software design tools and computer equipment for training, evaluation, testing and modelling.

Aerospace Engineers also work with the professionals of designing and aircraft and spacecraft building fields. Thus, they must also have better communication skills and know the right ways for the division of tasks for better management and achievements.

Top Recruiters of Aerospace Engineering:

Aerospace Engineering is a continuously evolving field, and recently it had acquired several advancements in various aspects, including the development and functioning of spacecraft and aircraft. Previously, only the governmental organizations used to be the principal entities involved in this field. Still, now, many private companies are also entering the sector, opening many gates for the Aerospace Engineering candidates.

Below are some best recruiters that every Aerospace Engineer must target for:

  • Indian Space Research Organization
  • National Aerospace Laboratories
  • Hindustan Aeronautical Limited
  • Defence Research and Development Organization
  • Airbus
  • Goodrich
  • GE
  • Boeing

Other careers related to Aerospace Engineers:

Aerospace Engineering provides various opportunities for the students, and the career options that the students can choose from are as follows:

Technicians for Aerospace Engineering and Operations:

These technicians work for the operation and maintenance of several types of equipment used for the development, testing, production, and sustaining of newer spacecraft and aircraft. These workers also make use of modelling based on computer and other simulation tools and processes along with advance robotics and automation.

Managers for Architectural and Engineering aspects:

They do the planning, directing, and coordination of the activities in Engineering and architectural companies.

Engineers of Computer Hardware:

These engineers do the research, designing, development, and testing of the computer systems and components like the routers, networks, memory devices, circuit boards, and processors.

Engineering Technicians of Electricals and Electronics:

They help the engineers in designing and developing the computers and communication equipment, monitoring devices, navigation equipment, and other electronics and electrical equipment. They also work for the evaluation and testing of the products and using the measuring and diagnostic tools for adjusting, testing, and repairing the equipment.

Engineers of Electricals and Electronics:

These people do the designing, development, testing, and supervising for the electrical equipment’s manufacturing, like radar, navigation systems, and electric motors. They also design and develop electronic equipment, including a communication system and a broadcasting device like GPS devices and music players.

Industrial Engineers:

They always reach out to the ways for eliminating the wastage in the production process. They come up with the efficient systems for integrating the workers, materials, energy, information, and machines, for providing any product or service.

Material Engineers:

These engineers develop, test, and process the materials for the creation of a broader range of products, including the aircraft wings and computer chips, biomedical devices, and golf clubs. They understand the structure and properties of metals, composites, plastics, ceramics, nanomaterials, and other substances for creating a newer material to meet some electrical, mechanical, and chemical needs.

Mechanical Engineers:

These people do the designing, development, building, and testing of thermal and mechanical sensors and devices, like some machines, engines, or tools.

Frequently Asked Questions:

Q1: What is there in the Aerospace Engineering course?

A1: These courses generally last from three to five years, depending on the qualification type that the student chooses. The students of the course get an in-depth understanding of the entire subject and its vital concepts. The students also understand the aerospace industry and the graduates working in several organizations.

Just after two years of the completion of the course, the students can also switch to the specialization courses. Placement for the bachelor courses of this field generally starts at the end of the third year, and many prominent institutions do the hiring for the eligible and talented candidates.

There are several subjects involved in the course that are uniformly divided along with the duration of the degree. In the end, the students are required to submit some major project for the degree’s completion.

Q2: What are the eligibility criteria for the Aerospace Engineering course?

A2: Candidates of applying for the course must have taken Maths and Science as main subjects in the higher secondary education. Furthermore, they must also have qualified the 12th boards with 60% or above for general category and 55% or above SC/ST. The students must also have better scores in entrance exams to seek some scholarship or at least get a seat reserved in any prominent institution,

Conclusion

Aerospace Engineering is a very unique and popular field of engineering degree for the graduation and post-graduation level. Many institutes also provide doctorate degrees and diploma courses for the area. These engineers mainly deal with aircraft and spacecraft related measures, and after taking the specialization, their stream can also involve more fascinating jobs.

Aerospace Engineers are required to work for longer hours and do significant designing jobs, development, testing, and monitoring of spacecraft and aircraft.

C++ print ascii code – C++ Program to print ASCII Value of All Alphabets

C++ print ascii code: In the previous article, we have discussed C++ Program to Find Power of a Number. In this article, we will see C++ Program to print ASCII Value of All Alphabets.

C++ Program to print ASCII Value of All Alphabets

  • Write a C++ program to print ASCII value of characters.

C++ Program to print ASCII value of a character

C++ Program to print ASCII value of a character

#include <iostream>
 
using namespace std;
  
int main() {
    char c;
     
    cout << "Enter a Character\n";
    cin >> c;
    // Prints the ASCII value of character
    cout << "ASCII value of " << c << " is " << (int)c;
      
    return 0;
}

Output

Enter a Character
A
ASCII value of A is 65
Enter a Character
a
ASCII value of a is 97

C++ Program to print ASCII value all alphabets

C++ Program to print ASCII value all alphabets

#include <iostream>
 
using namespace std;
  
int main() {
    char c;
 
    // Prints the ASCII value of all Uppercase Alphabet
    for(c = 'A'; c <= 'Z'; c++){
       cout << c << " = " << (int)c <<endl;
    }
      
    return 0;
}

Output

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

Access the online Sample C++ Programs list from here and clear all your queries regarding the coding and give your best in interviews and other examinations.