Linear Search in C and C++ Languages

Linear search simply means 'looking for an element in the whole array from one end to the other'. The searched element is compared with the first element of array first, then with the second, then with the third, so on upto the end of the array. This is time consuming when the array is pretty enough. The time complexity is highest.The C and C++ programs for linear search is given below.

C Program:

#include<stdio.h>

void main()
{

C and C++ Programs to Check Whether a Number is Strong Number or Not

This post contains C and C++ program to check whether a given number is Strong number or not. A strong number is a number for which the sum of factorials of its digits is equal to the number itself. The first one is C program to check whether the input number is a strong number or not. An example is 145. 1!+4!+5!=1+24+120=145 Therefore 145 is a strong number.

C Program:

#include<stdio.h>
long int factorial(int n)

{

Syllabus for First Year Btech under MG University (combined Ist & IInd Sem) (Common for all branches)

EN010 101 ENGINEERING MATHEMATICS – I

Credits: 5
Teaching Scheme
2 hour lecture and 1 hour tutorial per week

MODULE I (18 hours) - MATRIX
Elementary transformation – echelon form – rank using elementary transformation by reducing in to echelon
form – solution of linear homogeneous and non – homogeneous equations using elementary transformation.
Linear dependence and independence of vectors – eigen values and eigen vectors – properties of eigen values
and eigen vectors(proof not expected) – Linear transformation – Orthogonal transformation –
Diagonalisation – Reduction of quadratic form into sum of squares using orthogonal transformation – Rank,
index, signature of quadratic form – nature of quadratic form

BTech Computer Science and Engineering Third Semester Syllabus for MG University

The syllabus for Third semester BTech Computer Science and Engineering under MG (Mahatma Gandhi) University is given below. You can also download the syllabus.
Click here to download as pdf


EN010301B ENGINEERING MATHEMATICS II (CS, IT)

Credits 4


MODULE 1 Mathematical logic (12 hours)

Basic concept of statement, logical connectives, Tautology and logical equivalence - Laws of algebra of propositions - equivalence formulas- Tautological implications (proof not expected for the above laws, formulas and implications). Theory of inference for statements — Predicate calculus - quantifiers - valid formulas and equivalences -free and bound variables - inference theory of predicate calculus

BTech Computer Science and Engineering Fourth Semester Syllabus - MG University

This post contains the syllabus for Fourth semester BTech Computer Science and Engineering from Mahatma Gandhi University (MG University), Kottayam. Click here to download pdf

EN 010 401 ENGINEERING MATHEMATICS III (Common to all branches)

Teaching scheme Credits: 4
2 hours lecture and 2 hour tutorial per week



MODULE 1 FOURIER SERIES (12 hours)

Dirichlet conditions - Fourier series with period 2π and 2l - Half range sine and cosine series - Harmonic Analysis - r.m.s Value

BTech Civil Engineering Third Semester Syllabus for MG University Students

You can download the syllabus for third semester civil engineering under MG (Mahatma Gandhi) university, Kerala. Click here to Download as pdf.


EN010301A ENGINEERING MATHEMATICS II

(common to all branches except CS & IT)
credits:4
[Teaching Scheme: 2 hours lecture and 2 hours tutorial per week]

MODULE 1: Vector differential calculus ( 12 hours)

Scalar and vector fields-gradient -physical meaning-directional derivative-divergence and curl-physical meaning-scalar potential conservative field-identities-simple problems.

How To Make a Text Subscript or Superscript Using HTML Code

To make a text superscript or subscript in a webpage using HTML language, there are two tags provided in the language.

Superscript

To make a text or some characters superscript, the HTML tag <sup> is used. For example, suppose we have to display 2n+1. To display it, we have to use the following code:

2<sup>n+1</sup>

We have to enclose the characters to be made superscript in <sup> and </sup>

Binary to Gray Code Converter

This post is to teach you how to convert binary number to corresponding Gray code. The conversion is so simple. You can see it..

If an n bit binary number is represented by Bn Bn-1 ...B1 and its Gray code equivalent by Gn Gn-1...G1 where Bn and Gn are the most significant bits (MSBs), then the Gray code bits are obtained from the binary code as follows. The symbol ⊕ stands for the Exclusive OR (XOR) operation explained below.

The conversion procedure is as follows:

String Comparison in C and C++ Languages and Working of strcmp function

In both C and C++ programming languages, an inbuilt function strcmp() is used to compare two strings. This function is defined in string.h header file. So, to use this function, you have to include the header file string.h in the program. Most of the people ( i mean beginners) have a wrong idea about the working of the this function. I also had made some false assumptions. This function takes two strings as arguments. And it compares the two strings using the ASCII equivalent of each character. Some of the false ideas about this function are:
  • The function returns 1 when the strings are equal and 0 when they are not equal
  • The function returns 1 when they are not equal
  • The function returns 1 when the first string is greater than the second and returns -1 when the first one is less than the second one