International Journal of Mathematics & Computing. Research Article

Size: px
Start display at page:

Download "International Journal of Mathematics & Computing. Research Article"

Transcription

1 Open Access Scientific Publisher Research Article C/C++ PROGRAM: DETERMINATION OF ENERGY BAND GAP FROM UV-VISIBLE SPECTROGRAPH RESULTS ABSTRACT Rajivgandhi S 1, Dinesh Kumar A 2, Balamurugan K 2 1 Assistant Professor of Physics, Dhanalakshmi Srinivasan Engineering College, Perambalur, Tamilnadu, India 2 Assistant Professor of Mathematics, Dhanalakshmi Srinivasan Engineering College, Perambalur, Tamilnadu, India. Correspondence should be addressed to Rajivgandhi S Received June 16, 2015; Accepted July 02, 2015; Published July 07, 2015; Copyright: 2015 Rajivgandhi S et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Cite This Article:S, R., A, D., K, B.(2015). C/C++ Program: Determination of Energy Band Gap from UV-Visible Spectrograph Results. International Journal of Mathematics & Computing, 1(1).1-6 Currently computers are used in all areas of research and development. Main theme of this article is how and why we will use the high level programming languages like C/C++ languages for simple calculation in physics. This article reports the energy band gap of materials using C program. The calculation made by characterization of sample using absorbance spectrum of sample is obtained from UV Vis Spectrometer. We have written and executed the C program successfully for the calculation of band gap energy. While executing the program we got better and accurate results. KEY WORDS:C/C++ program, energy band gap, UV-Visible spectrograph INTRODUCTION computer is an automatic electronic machine for making calculation and controlling operations that are expressible in numerical or logical term. The old version computers are less powerful and usage compared than today s computer. Earlier versions are designed with much less advantage. But today s computers are more powerful and have more usage. Now-a-days computers are used in science and engineering, aerospace technology, weather report, pollution, agriculture, economic planning, astronomy, bio-medical, real time speech recognition, robotics and etc. Many scientific instruments are programmed in C (e.g., CCD cameras and special purpose interface cards invariably come with a C library interfaces). In general, problems in physics are very difficult to solve exactly. In physics, more problems are solved by C/C++ programs. Especially in mathematical physics, numerical calculations such as Newton-Raphson method, Range-Kutta method, Simpson rule, Euler formula, etc., are simply done by C/C++ programs. Similarly classical mechanics, quantum mechanics, nuclear physics and nonlinear optics problems are also easily solved by computer languages. We are facing some difficulties to calculate energy band gap manually while writing my previous article. To come out from that difficulty, we think how do we solve this problem simply? We found one good idea that is C/C++ programming. It is a simplest method and time consumption is low METHOD OF DETERMINING ENERGY BAND GAP USING C/C++ PROGRAM The prepared samples are characterized by UV-Visible spectrometer. After completion of the characterization process we have two spectrum namely absorbance and transmittance spectrum. Since the spectrum we take value of wavelength at absorbance or transmittance edge for calculation. 1

2 Formula used International Journal of Mathematics & Computing The below mentioned formula is taken to calculate the Energy band gap of the materials [1] Where, E g = hc λ J =hc λe ev h -Plank s constant (6.625x10-34 J.sec) C - Velocity of light (3x10 8 m/s) E x10-19 Coulomb Program execution process Develop an algorithm and flowchart Write the program in computer language Enter the program in to the computer Test and debug the program Run the program, input data and get the results from the computer Single sample Coding Algorithm Start the program Read the lambda value Calculate E = ((h*c)/ (lambda*e)*1000) Print the value of lambda and E Stop the program FLOW CHART: START READ lambda CALCULATE E = ((h*c) / (lambda*e)*1000) PRINT lambdaand E 2 STOP

3 PROGRAM International Journal of Mathematics & Computing include<stdio.h> include<conio.h> include<string.h> void main() float h=6.625,c=3,e=1.602,lambda,e; clrscr(); printf("enter the value of lambda in angstrom unit:"); scanf("%f",&lambda); E=((h*c)/(e*lambda)*1000); printf("\n \n"); printf(" CALCULATION OF ENERGY BAND GAP \n"); printf(" \n"); printf("lambda\t\t\t\tenergy band gap \nin X10^(-10)m\t\t\tin ev\n"); printf(" \n"); printf("%f\t\t\t%f\n",lambda,e); printf(" \n"); printf("\th=6.625x10^(-34)j.sec c=3x10^8 m/sec\n"); printf(" "); getch(); Multi sample Coding Algorithm Start the program Read the n and lambda value Initialize i. If the condition i<=n is true, calculate, E = ((h*c)/(lambda*e)*1000).go to step 5 f the condition is false go to step 5 Print the value of lambda and E Stop the program 3

4 FLOW CHART START READ n and lambda for(i=1;i<=n;i++) FALSE TRUE CALCULATE E = ((h*c) / (lambda*e)*1000) PRINT SNo, Samplecode, lambda & E PROGRAM STOP include<stdio.h> include<conio.h> include<string.h> void main() Int SNo[100],n,i; Char Samplecode[20]; float h=6.625,c=3,e=1.602,lambda[100],e; clrscr(); printf("enter 'n' value:"); scanf("%d",&n); for(i=1;i<=n;i++) {printf("\nsno %d:\n",i); printf("enter Samplecode:\n"); 4 scanf("%s",samplecode[i]); printf("enter lambda value in angstrom unit:\n"); scanf("%f",&lambda[i]); clrscr();

5 printf("\n \n"); printf(" \t CALCULATION OF ENERGY BAND GAP \n"); printf(" \n"); printf("sno\tsamplecode\tlambda\t\t\tenergy band gap \n\t\t\tin X10^(-10)m\t\tin ev\n"); printf(" \n"); for(i=1;i<=n;i++){ E=((h*c)/(e*lambda[i])*1000); printf("%d\t%s\t\t%f\t\t%f\n",i,samplecode[i],lambda[i],e); printf(" \n");} printf("\th=6.625x10^(-34)j.sec c=3x10^8 m/sec\n"); printf(" "); getch();} RESULTS Procedure to get output The users should follow the following steps. Install TurboC3/TurboC4 in computer. Feed the program in to the computer. Save the program with appropriate extension. For example, filename.c or filename.cpp Press ALT+F9 or click on Compile on menu bar If it shows any error, edit the program. Else if no error press CTRL+F9 or click Run on menu bar. Now enter input data. Output is displayed as shown in fig 1 and fig 2. Figure 1: Output and Results for single sample 5

6 Figure 2:Output and Results for multi sample DISCUSSIONS The user should enter the lambda value in terms of angstrom unit(x10-10 m) only. The user doesn t worry about that the powers of inputs. You just enter the integer value only. Powers of inputs are calculated manually and are adjusted in our program. Consider the following example, E= hc λe = 6.625x x3x x10 10 x1.602x 10 19= x103 = x1000 = ev. If the user is willing to enter the wavelength in nano meters (10-9 m), multiply by 100 and make necessary change in the formula, E=((h*C/lambda*e)*100). CONCLUSION AND FUTURE ENHANCEMENTS Computers play a vital role in research and development. It reduces the time consumption in calculation. Some High level languages made easy to calculate this parameter rather than manual calculation. The energy band gap determination is one of the important parameter to analyse the characteristics of chemical elements. In the field of research and development, it is a part. This characterization is very useful to classify the material whether conductor or insulator or semiconductor. The energy band gaps are determined with the help of computer(c Program). In future we need some improvement in turbo C/C++ software. First problem is while run the program powers of inputs can t be entered when the computer asked to enter the input data. Another one is power of output also cannot be displayed in monitor. REFERENCES [1] Jayant Dharma, PerkinElmer Technical Center, Aniruddha Pisal, Global Application Laboratory, PerkinElmer, Inc. Shelton, CT USA. Simple Method of Measuring the Band Gap Energy Value of TiO2 in the Powder Form using a UV/Vis/NIR Spectrometer. 6

LABORATORY MANUAL. (CSE-103F) FCPC Lab

LABORATORY MANUAL. (CSE-103F) FCPC Lab LABORATORY MANUAL (CSE-103F) FCPC Lab Department of Computer Science & Engineering BRCM College of Engineering & Technology Bahal, Haryana Aim: Main aim of this course is to understand and solve logical

More information

Unit 3 Decision making, Looping and Arrays

Unit 3 Decision making, Looping and Arrays Unit 3 Decision making, Looping and Arrays Decision Making During programming, we have a number of situations where we may have to change the order of execution of statements based on certain conditions.

More information

Subject: Fundamental of Computer Programming 2068

Subject: Fundamental of Computer Programming 2068 Subject: Fundamental of Computer Programming 2068 1 Write an algorithm and flowchart to determine whether a given integer is odd or even and explain it. Algorithm Step 1: Start Step 2: Read a Step 3: Find

More information

International Journal of Advanced Research in Computer Science and Software Engineering

International Journal of Advanced Research in Computer Science and Software Engineering Volume 2, Issue 9, September 2012 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com Case Study

More information

Case Control Structure. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Case Control Structure. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan Case Control Structure DCS COMSATS Institute of Information Technology Rab Nawaz Jadoon Assistant Professor COMSATS IIT, Abbottabad Pakistan Introduction to Computer Programming (ICP) Decision control

More information

Design of High capacity, reliable, efficient Long distance communication network. using DWDM

Design of High capacity, reliable, efficient Long distance communication network. using DWDM Design of High capacity, reliable, efficient Long distance communication network using DWDM V.Ranjani 1, R.Rajeshwari 2, R.Ranjitha 3, P.Nalini 4 1. B.E Student, 2. B.E Student 3. B.E Student, 4. Assistant

More information

LAB MANUAL. ANTC Lab (ME-321- F) DEPARTMENT OF APPLIED SCIENCE AND HUMINITIES

LAB MANUAL. ANTC Lab (ME-321- F) DEPARTMENT OF APPLIED SCIENCE AND HUMINITIES LAB MANUAL ANTC Lab (ME-321- F) DEPARTMENT OF APPLIED SCIENCE AND HUMINITIES 1 Check list for Lab Manual S. No. Particulars Page Number 1 Mission and Vision 3 2 Guidelines for the student 4 3 List of Programs

More information

Decision Making and Branching

Decision Making and Branching INTRODUCTION Decision Making and Branching Unit 4 In the previous lessons we have learned about the programming structure, data types, declaration of variables, tokens, constants, keywords and operators

More information

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate

More information

CS11001/CS11002 Programming and Data Structures (PDS) (Theory: 3-1-0) Introduction to arrays

CS11001/CS11002 Programming and Data Structures (PDS) (Theory: 3-1-0) Introduction to arrays CS11001/CS11002 Programming and Data Structures (PDS) (Theory: 3-1-0) Introduction to arrays 1 What are Arrays? Arrays are our first example of structured data. Think of a book with pages numbered 1,2,...,400.

More information

Q 1. Attempt any TEN of the following:

Q 1. Attempt any TEN of the following: Subject Code: 17212 Model Answer Page No: 1 / 26 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The

More information

Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program

Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program written in a high-level programming language into machine

More information

UNIT 3 FUNCTIONS AND ARRAYS

UNIT 3 FUNCTIONS AND ARRAYS UNIT 3 FUNCTIONS AND ARRAYS Functions Function definitions and Prototypes Calling Functions Accessing functions Passing arguments to a function - Storage Classes Scope rules Arrays Defining an array processing

More information

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY, VIRUDHUNAGAR Department of CSE & IT Internal Test I

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY, VIRUDHUNAGAR Department of CSE & IT Internal Test I SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY, VIRUDHUNAGAR Department of CSE & IT Internal Test I Year & Sem: I B.E (CSE) & II Date of Exam: 21/02/2015 Subject Code & Name: CS6202 & Programming & Data

More information

FUNCTIONS OMPAL SINGH

FUNCTIONS OMPAL SINGH FUNCTIONS 1 INTRODUCTION C enables its programmers to break up a program into segments commonly known as functions, each of which can be written more or less independently of the others. Every function

More information

Tutorial No. 2 - Solution (Overview of C)

Tutorial No. 2 - Solution (Overview of C) Tutorial No. 2 - Solution (Overview of C) Computer Programming and Utilization (2110003) 1. Explain the C program development life cycle using flowchart in detail. OR Explain the process of compiling and

More information

C Programming Lecture V

C Programming Lecture V C Programming Lecture V Instructor Özgür ZEYDAN http://cevre.beun.edu.tr/ Modular Programming A function in C is a small sub-program that performs a particular task, and supports the concept of modular

More information

It is necessary to have a single function main in every C program, along with other functions used/defined by the programmer.

It is necessary to have a single function main in every C program, along with other functions used/defined by the programmer. Functions A number of statements grouped into a single logical unit are called a function. The use of function makes programming easier since repeated statements can be grouped into functions. Splitting

More information

Using Ones Assignment Method and. Robust s Ranking Technique

Using Ones Assignment Method and. Robust s Ranking Technique Applied Mathematical Sciences, Vol. 7, 2013, no. 113, 5607-5619 HIKARI Ltd, www.m-hikari.com http://dx.doi.org/10.12988/ams.2013.37381 Method for Solving Fuzzy Assignment Problem Using Ones Assignment

More information

Unit 5. Decision Making and Looping. School of Science and Technology INTRODUCTION

Unit 5. Decision Making and Looping. School of Science and Technology INTRODUCTION INTRODUCTION Decision Making and Looping Unit 5 In the previous lessons we have learned about the programming structure, decision making procedure, how to write statements, as well as different types of

More information

TRACING BACK A BINARY TREE

TRACING BACK A BINARY TREE TRACING BACK A BINARY TREE Dr. Mrs. Meenakshi M. Sagdeo 1 ABSTRACT: Binary tree is a nonlinear data structure, mainly used to represent data containing a hierarchical relationship between elements. There

More information

& Technology. G) Functions. void. Argument2, Example: (Argument1, Syllabus for 1. 1 What. has a unique. 2) Function name. passed to.

& Technology. G) Functions. void. Argument2, Example: (Argument1, Syllabus for 1. 1 What. has a unique. 2) Function name. passed to. Computer Programming and Utilization (CPU) 110003 G) Functions 1 What is user defined function? Explain with example. Define the syntax of function in C. A function is a block of code that performs a specific

More information

Unit 3 Functions. 1 What is user defined function? Explain with example. Define the syntax of function in C.

Unit 3 Functions. 1 What is user defined function? Explain with example. Define the syntax of function in C. 1 What is user defined function? Explain with example. Define the syntax of function in C. A function is a block of code that performs a specific task. The functions which are created by programmer are

More information

UIC. C Programming Primer. Bharathidasan University

UIC. C Programming Primer. Bharathidasan University C Programming Primer UIC C Programming Primer Bharathidasan University Contents Getting Started 02 Basic Concepts. 02 Variables, Data types and Constants...03 Control Statements and Loops 05 Expressions

More information

Course Code : MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/13 Maximum Marks : 100 Weightage : 25%

Course Code : MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/13 Maximum Marks : 100 Weightage : 25% For more IGNOU Solved Assignments visit www.ignouhelp.in Get Daily Updates by Facebook: https://www.facebook.com/ignouhelp.in Course Code : MCS011 Course Title : Problem Solving and Programming Assignment

More information

HIGHER SCEONDARY FIRST YEAR PRACTICAL EXAM 2018 COMPUTER SCIENCE SECTION A ( WINDOWS XP )

HIGHER SCEONDARY FIRST YEAR PRACTICAL EXAM 2018 COMPUTER SCIENCE SECTION A ( WINDOWS XP ) HIGHER SCEONDARY FIRST YEAR PRACTICAL EXAM 2018 COMPUTER SCIENCE SECTION A ( WINDOWS XP ) 1.Write the steps to do the Following: a) Enter in to WordPad b) Enter 3 lines with suitable Heading c) Save the

More information

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE 1. Write a C program to perform addition, subtraction, multiplication and division of two numbers. # include # include int a, b,sum,

More information

7.STRINGS. Data Structure Management (330701) 1

7.STRINGS. Data Structure Management (330701)   1 Strings and their representation String is defined as a sequence of characters. 7.STRINGS In terms of c language string is an array of characters. While storing the string in character array the size of

More information

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI 621213 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Sub code: CS2203 SEM: III Sub Name: Object Oriented Programming Year: II UNIT-I PART-A 1. What is

More information

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be

More information

Control of Light. Emmett Ientilucci Digital Imaging and Remote Sensing Laboratory Chester F. Carlson Center for Imaging Science 8 May 2007

Control of Light. Emmett Ientilucci Digital Imaging and Remote Sensing Laboratory Chester F. Carlson Center for Imaging Science 8 May 2007 Control of Light Emmett Ientilucci Digital Imaging and Remote Sensing Laboratory Chester F. Carlson Center for Imaging Science 8 May 007 Spectro-radiometry Spectral Considerations Chromatic dispersion

More information

Chapter 8 Character Arrays and Strings

Chapter 8 Character Arrays and Strings Chapter 8 Character Arrays and Strings INTRODUCTION A string is a sequence of characters that is treated as a single data item. String constant: String constant example. \ String constant example.\ \ includes

More information

Programming and Data Structures Mid-Semester - Solutions to Sample Questions Dept. of Computer Science and Engg. IIT Kharagpur Spring

Programming and Data Structures Mid-Semester - Solutions to Sample Questions Dept. of Computer Science and Engg. IIT Kharagpur Spring Programming and Data Structures Mid-Semester - s to Sample Questions Dept. of Computer Science and Engg. IIT Kharagpur Spring 2015-16 February 15, 2016 1. Tick the correct options. (a) Consider the following

More information

Chapter - 2 Complexity of Algorithms for Iterative Solution of Non-Linear Equations

Chapter - 2 Complexity of Algorithms for Iterative Solution of Non-Linear Equations Chapter - Compleity of Algorithms for Iterative Solution of Non-Linear Equations Compleity of Algorithms for Iterative... 19 CHAPTER - Compleity of Algorithms for Iterative Solution of Non-Linear Equations.1

More information

C LANGUAGE AND ITS DIFFERENT TYPES OF FUNCTIONS

C LANGUAGE AND ITS DIFFERENT TYPES OF FUNCTIONS C LANGUAGE AND ITS DIFFERENT TYPES OF FUNCTIONS Manish Dronacharya College Of Engineering, Maharishi Dayanand University, Gurgaon, Haryana, India III. Abstract- C Language History: The C programming language

More information

A Comparative Study on Optimization Techniques for Solving Multi-objective Geometric Programming Problems

A Comparative Study on Optimization Techniques for Solving Multi-objective Geometric Programming Problems Applied Mathematical Sciences, Vol. 9, 205, no. 22, 077-085 HIKARI Ltd, www.m-hikari.com http://dx.doi.org/0.2988/ams.205.42029 A Comparative Study on Optimization Techniques for Solving Multi-objective

More information

Module 4: Decision-making and forming loops

Module 4: Decision-making and forming loops 1 Module 4: Decision-making and forming loops 1. Introduction 2. Decision making 2.1. Simple if statement 2.2. The if else Statement 2.3. Nested if Statement 3. The switch case 4. Forming loops 4.1. The

More information

Sir Syed University of Engineering and Technology. Computer Programming & Problem Solving ( CPPS )

Sir Syed University of Engineering and Technology. Computer Programming & Problem Solving ( CPPS ) Computer Programming & Problem Solving ( CPPS ) Chapter No 2 Sir Syed University of Engineering & Technology Computer Engineering Department University Road, Karachi-75300, PAKISTAN Muzammil Ahmad Khan

More information

Program. SUBJECT: ACP (C - Programming) Array Program. // Find the minimum number from given N element. Prepared By : Dhaval R.

Program. SUBJECT: ACP (C - Programming) Array Program. // Find the minimum number from given N element. Prepared By : Dhaval R. Program // Find the minimum number from given N element. #include #include void main() int a[50],i,n,min; clrscr(); printf("\n Enter array size : "); scanf("%d",&n); printf("\n Enter

More information

'C' Programming Language

'C' Programming Language F.Y. Diploma : Sem. II [DE/EJ/ET/EN/EX] 'C' Programming Language Time: 3 Hrs.] Prelim Question Paper Solution [Marks : 70 Q.1 Attempt any FIVE of the following : [10] Q.1(a) Define pointer. Write syntax

More information

Prepared by: Shraddha Modi

Prepared by: Shraddha Modi Prepared by: Shraddha Modi Introduction Operator: An operator is a symbol that tells the Computer to perform certain mathematical or logical manipulations. Expression: An expression is a sequence of operands

More information

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet BRAIN INTERNATIONAL SCHOOL Term-I Class XI 2018-19 Sub: Computer Science Revision Worksheet Chapter-1. Computer Overview 1. Which electronic device invention brought revolution in earlier computers? 2.

More information

Unit 4 Preprocessor Directives

Unit 4 Preprocessor Directives 1 What is pre-processor? The job of C preprocessor is to process the source code before it is passed to the compiler. Source Code (test.c) Pre-Processor Intermediate Code (test.i) Compiler The pre-processor

More information

Assignment 6. Q1. Create a database of students using structures, where in each entry of the database will have the following fields:

Assignment 6. Q1. Create a database of students using structures, where in each entry of the database will have the following fields: Assignment 6 Q1. Create a database of students using structures, where in each entry of the database will have the following fields: 1. a name, which is a string with at most 128 characters 2. their marks

More information

DEV BHOOMI INSTITUTE OF TECHNOLOGY

DEV BHOOMI INSTITUTE OF TECHNOLOGY DEV BHOOMI INSTITUTE OF TECHNOLOGY Department of Computer Science and Engineering Year: 2rd Semester: 3rd CBNST Lab-PCS-302 LAB MANUAL Prepared By: HOD (CSE) DEV BHOOMI INSTITUTE OF TECHNOLOGY Department

More information

An array is a collection of similar elements that is all the elements in an array should have same data type. This means that an array can store

An array is a collection of similar elements that is all the elements in an array should have same data type. This means that an array can store An array is a collection of similar elements that is all the elements in an array should have same data type. This means that an array can store either all integers, all floating point numbers, all characters,

More information

Problem # 1. calculate the grade. Allow a student the next grade if he/she needs only 0.5 marks to obtain the next grade. Use else-if construction.

Problem # 1. calculate the grade. Allow a student the next grade if he/she needs only 0.5 marks to obtain the next grade. Use else-if construction. ME 172 Lecture 6 Problem # 1 Write a program to calculate the grade point average of a 3.00 credit hour course using the data obtained from the user. Data contains four items: attendance (30), class test

More information

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size];

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size]; Arrays An array is a collection of two or more adjacent memory cells, called array elements. Array is derived data type that is used to represent collection of data items. C Array is a collection of data

More information

AROUND THE WORLD OF C

AROUND THE WORLD OF C CHAPTER AROUND THE WORLD OF C 1 1.1 WELCOME TO C LANGUAGE We want to make you reasonably comfortable with C language. Get ready for an exciting tour. The problem we would consider to introduce C language

More information

ihr Series horiba.com/osd Research Grade Spectrometers Simply the best imaging spectrometers with no compromise

ihr Series horiba.com/osd Research Grade Spectrometers Simply the best imaging spectrometers with no compromise ihr Series Research Grade Spectrometers Simply the best imaging spectrometers with no compromise horiba.com/osd Unmatched Flexibility in Applications HORIBA Scientific s Optical Spectroscopy Division

More information

//2D TRANSFORMATION TRANSLATION, ROTATING AND SCALING. #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<stdlib.

//2D TRANSFORMATION TRANSLATION, ROTATING AND SCALING. #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> #include<stdlib. //2D TRANSFORMATION TRANSLATION, ROTATING AND SCALING #include #include #include #include #include void main() int gd=detect,gm,i,x[10],y[10],a,b,c,d,n,tx,ty,sx,sy,ch;

More information

Image Segmentation Based on. Modified Tsallis Entropy

Image Segmentation Based on. Modified Tsallis Entropy Contemporary Engineering Sciences, Vol. 7, 2014, no. 11, 523-529 HIKARI Ltd, www.m-hikari.com http://dx.doi.org/10.12988/ces.2014.4439 Image Segmentation Based on Modified Tsallis Entropy V. Vaithiyanathan

More information

SELECTION STATEMENTS:

SELECTION STATEMENTS: UNIT-2 STATEMENTS A statement is a part of your program that can be executed. That is, a statement specifies an action. Statements generally contain expressions and end with a semicolon. Statements that

More information

Lecture 6. Statements

Lecture 6. Statements Lecture 6 Statements 1 Statements This chapter introduces the various forms of C++ statements for composing programs You will learn about Expressions Composed instructions Decision instructions Loop instructions

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College October 24, 2018 Outline Outline 1 Chapter 8: A C++ Introduction For Python Programmers Expressions and Operator Precedence

More information

Computer Programming Unit 3

Computer Programming Unit 3 POINTERS INTRODUCTION Pointers are important in c-language. Some tasks are performed more easily with pointers such as dynamic memory allocation, cannot be performed without using pointers. So it s very

More information

Strings and Library Functions

Strings and Library Functions Unit 4 String String is an array of character. Strings and Library Functions A string variable is a variable declared as array of character. The general format of declaring string is: char string_name

More information

Expressions and Casting

Expressions and Casting Expressions and Casting C# Programming Rob Miles Data Manipulation We know that programs use data storage (variables) to hold values and statements to process the data The statements are obeyed in sequence

More information

Unit 1 - Arrays. 1 What is an array? Explain with Example. What are the advantages of using an array?

Unit 1 - Arrays. 1 What is an array? Explain with Example. What are the advantages of using an array? 1 What is an array? Explain with Example. What are the advantages of using an array? An array is a fixed-size sequenced collection of elements of the same data type. An array is derived data type. The

More information

List of Programs: Programs: 1. Polynomial addition

List of Programs: Programs: 1. Polynomial addition List of Programs: 1. Polynomial addition 2. Common operations on vectors in c 3. Matrix operation: multiplication, transpose 4. Basic Unit conversion 5. Number conversion: Decimal to binary 6. Number conversion:

More information

Government Polytechnic Muzaffarpur.

Government Polytechnic Muzaffarpur. Government Polytechnic Muzaffarpur. Name of the Lab: COMPUTER PROGRAMMING LAB (MECH. ENGG. GROUP) Subject Code: 1625408 Experiment: 1 Aim: Programming exercise on executing a C program. If you are looking

More information

MGM S JAWAHARLAL NEHRU ENGINEERING COLLEGE N-6, CIDCO, AURANGABAD LAB MANUALS SUB: COMPUTER LAB-II CLASS: S.E.CIVIL

MGM S JAWAHARLAL NEHRU ENGINEERING COLLEGE N-6, CIDCO, AURANGABAD LAB MANUALS SUB: COMPUTER LAB-II CLASS: S.E.CIVIL MGM S JAWAHARLAL NEHRU ENGINEERING COLLEGE N-6, CIDCO, AURANGABAD LAB MANUALS (Procedure for conduction of Practical/Term Work) SUB: COMPUTER LAB-II CLASS: S.E.CIVIL Prepared by Ms.V.S.Pradhan Lab In charge

More information

Open Access Research on the Prediction Model of Material Cost Based on Data Mining

Open Access Research on the Prediction Model of Material Cost Based on Data Mining Send Orders for Reprints to reprints@benthamscience.ae 1062 The Open Mechanical Engineering Journal, 2015, 9, 1062-1066 Open Access Research on the Prediction Model of Material Cost Based on Data Mining

More information

Arrays in C. By Mrs. Manisha Kuveskar.

Arrays in C. By Mrs. Manisha Kuveskar. Arrays in C By Mrs. Manisha Kuveskar. C Programming Arrays An array is a collection of data that holds fixed number of values of same type. For example: if you want to store marks of 100 students, you

More information

SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, ) SOLUTION

SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, ) SOLUTION SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, 2016-17) SOLUTION Program: B. Tech. Branch: All Term:I Subject: Logic Building and Problem Solving Using C Paper Code:

More information

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1 E40M LEDs, Time Multiplexing M. Horowitz, J. Plummer, R. Howe 1 Reading Course Reader 2.6 LEDs Course Reader 5.8 - Multiplexing LEDs https://learn.adafruit.com/all-about-leds http://dangerousprototypes.com/docs/

More information

UNIT - V STRUCTURES AND UNIONS

UNIT - V STRUCTURES AND UNIONS UNIT - V STRUCTURES AND UNIONS STRUCTURE DEFINITION A structure definition creates a format that may be used to declare structure variables. Let us use an example to illustrate the process of structure

More information

CSE / ENGR 142 Programming I

CSE / ENGR 142 Programming I CSE / ENGR 142 Programming I Variables, Values, and Types Chapter 2 Overview Chapter 2: Read Sections 2.1-2.6, 2.8. Long chapter, short snippets on many topics Later chapters fill in detail Specifically:

More information

Multiple Choice Questions ( 1 mark)

Multiple Choice Questions ( 1 mark) Multiple Choice Questions ( 1 mark) Unit-1 1. is a step by step approach to solve any problem.. a) Process b) Programming Language c) Algorithm d) Compiler 2. The process of walking through a program s

More information

Arrays a kind of data structure that can store a fixedsize sequential collection of elements of the same type. An array is used to store a collection

Arrays a kind of data structure that can store a fixedsize sequential collection of elements of the same type. An array is used to store a collection Morteza Noferesti Arrays a kind of data structure that can store a fixedsize sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful

More information

Unit 8. Structures and Unions. School of Science and Technology INTRODUCTION

Unit 8. Structures and Unions. School of Science and Technology INTRODUCTION INTRODUCTION Structures and Unions Unit 8 In the previous unit 7 we have studied about C functions and their declarations, definitions, initializations. Also we have learned importance of local and global

More information

Module 6: Array in C

Module 6: Array in C 1 Table of Content 1. Introduction 2. Basics of array 3. Types of Array 4. Declaring Arrays 5. Initializing an array 6. Processing an array 7. Summary Learning objectives 1. To understand the concept of

More information

AE52/AC52/AT52 C & Data Structures JUNE 2014

AE52/AC52/AT52 C & Data Structures JUNE 2014 Q.2 a. Write a program to add two numbers using a temporary variable. #include #include int main () int num1, num2; clrscr (); printf( \n Enter the first number : ); scanf ( %d, &num1);

More information

Computer Programming & Problem Solving ( CPPS ) Turbo C Programming For The PC (Revised Edition ) By Robert Lafore

Computer Programming & Problem Solving ( CPPS ) Turbo C Programming For The PC (Revised Edition ) By Robert Lafore Sir Syed University of Engineering and Technology. Computer ming & Problem Solving ( CPPS ) Functions Chapter No 1 Compiled By: Sir Syed University of Engineering & Technology Computer Engineering Department

More information

As stated earlier, the declaration

As stated earlier, the declaration The int data type As stated earlier, the declaration int a; is an instruction to the compiler to reserve a certain amount of memory to hold the values of the variable a. How much memory? Two bytes (usually,

More information

Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That

Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That 1. Introduction You have seen situations in which the way numbers are stored in a computer affects a program. For example, in the

More information

/* Polynomial Expressions Using Linked List*/ #include<stdio.h> #include<conio.h> #include <malloc.h> struct node. int num; int coeff;

/* Polynomial Expressions Using Linked List*/ #include<stdio.h> #include<conio.h> #include <malloc.h> struct node. int num; int coeff; /* Polynomial Expressions Using Linked List*/ #include #include #include struct node int num; int coeff; struct node *next; ; struct node *start1 = NULL; struct node *start2

More information

MCA Semester 1. MC0061 Computer Programming C Language 4 Credits Assignment: Set 1 (40 Marks)

MCA Semester 1. MC0061 Computer Programming C Language 4 Credits Assignment: Set 1 (40 Marks) Summer 2012 MCA Semester 1 4 Credits Assignment: Set 1 (40 Marks) Q1. Explain the following operators with an example for each: a. Conditional Operators b. Bitwise Operators c. gets() and puts() function

More information

Computers Programming Course 7. Iulian Năstac

Computers Programming Course 7. Iulian Năstac Computers Programming Course 7 Iulian Năstac Recap from previous course Operators in C Programming languages typically support a set of operators, which differ in the calling of syntax and/or the argument

More information

KARMAYOGI ENGINEERING COLLEGE, Shelve Pandharpur

KARMAYOGI ENGINEERING COLLEGE, Shelve Pandharpur KARMAYOGI ENGINEERING COLLEGE, Shelve Pandharpur Bachelor of Engineering First Year Subject Name: Computer Programming Objective: 1. This course is designed to provide a brief study of the C programming

More information

Computer Programming & Problem Solving ( CPPS )

Computer Programming & Problem Solving ( CPPS ) Computer Programming & Problem Solving ( CPPS ) Chapter No 3 Sir Syed University of Engineering & Technology Computer Engineering Department University Road, Karachi-75300, PAKISTAN Muzammil Ahmad Khan

More information

NUMERICAL METHODS AND COMPUTATIONAL PROGRAMMING LAB MATH-204-F

NUMERICAL METHODS AND COMPUTATIONAL PROGRAMMING LAB MATH-204-F LAB MANUAL NUMERICAL METHODS AND COMPUTATIONAL PROGRAMMING LAB MATH-204-F LIST OF EXPERIMENTS NUMERICAL METHODS OF COMPUTATIONAL PROGRAMMING LAB MATH-204-F S. No. NAME OF EXPERIMENTS 1. Solution of Non-linear

More information

A control structure refers to the way in which the Programmer specifies the order of executing the statements

A control structure refers to the way in which the Programmer specifies the order of executing the statements Control Structures A control structure refers to the way in which the Programmer specifies the order of executing the statements The following approaches can be chosen depending on the problem statement:

More information

Computer Science III WEEK4 Dr.Elgin KILIÇ

Computer Science III WEEK4 Dr.Elgin KILIÇ Computer Science III 2018-2019 LOOPS FOR LOOP STATEMENT WEEK4 Dr.Elgin KILIÇ A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number

More information

SOFTWARE TESTING LABORATORY. Subject Code: 10ISL68 I.A. Marks: 25 Hours/Week: 03 Exam Hours: 03 Total Hours: 42 Exam Marks: 50

SOFTWARE TESTING LABORATORY. Subject Code: 10ISL68 I.A. Marks: 25 Hours/Week: 03 Exam Hours: 03 Total Hours: 42 Exam Marks: 50 SOFTWARE TESTING LABORATORY Subject Code: 10ISL68 I.A. Marks: 25 Hours/Week: 03 Exam Hours: 03 Total Hours: 42 Exam Marks: 50 1. Design and develop a program in a language of your choice to solve the Triangle

More information

Available online through ISSN

Available online through  ISSN International Research Journal of Pure Algebra -4(4), 2014, 509-513 Available online through www.rjpa.info ISSN 2248 9037 A STUDY OF UNBALANCED TRANSPORTATION PROBLEM AND USE OF OBJECT ORIENTED PROGRAMMING

More information

Test Paper 3 Programming Language Solution Question 1: Briefly describe the structure of a C program. A C program consists of (i) functions and (ii) statements There should be at least one function called

More information

Prepared By:- Dinesh Sharma Asstt. Professor, CSE & IT Deptt. ITM Gurgaon

Prepared By:- Dinesh Sharma Asstt. Professor, CSE & IT Deptt. ITM Gurgaon Data Structures &Al Algorithms Prepared By:- Dinesh Sharma Asstt. Professor, CSE & IT Deptt. ITM Gurgaon What is Data Structure Data Structure is a logical relationship existing between individual elements

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 5 Structured Program Development Department of Computer Engineering How to develop

More information

Numerical Method (2068 Third Batch)

Numerical Method (2068 Third Batch) 1. Define the types of error in numerical calculation. Derive the formula for secant method and illustrate the method by figure. There are different types of error in numerical calculation. Some of them

More information

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1 E40M LEDs, Time Multiplexing M. Horowitz, J. Plummer, R. Howe 1 Reading Course Reader 2.6 LEDs Course Reader 5.8 - Multiplexing LEDs https://learn.adafruit.com/all-about-leds http://dangerousprototypes.com/docs/

More information

AMCAT Automata Coding Sample Questions And Answers

AMCAT Automata Coding Sample Questions And Answers 1) Find the syntax error in the below code without modifying the logic. #include int main() float x = 1.1; switch (x) case 1: printf( Choice is 1 ); default: printf( Invalid choice ); return

More information

F.E. Sem. II. Structured Programming Approach

F.E. Sem. II. Structured Programming Approach F.E. Sem. II Structured Programming Approach Time : 3 Hrs.] Mumbai University Examination Paper Solution - May 14 [Marks : 80 Q.1(a) What do you mean by algorithm? Which points you should consider [4]

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 5 - Structured Program Development Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad How to develop a program? Requirements Problem Analysis

More information

Prepared by: Shraddha Modi

Prepared by: Shraddha Modi Prepared by: Shraddha Modi Introduction In looping, a sequence of statements are executed until some conditions for termination of the loop are satisfied. A program loop consist of two segments Body of

More information

Structures in C. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Structures in C. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan Structures in C DCS COMSATS Institute of Information Technology Rab Nawaz Jadoon Assistant Professor COMSATS IIT, Abbottabad Pakistan Introduction to Computer Programming (ICP) Structures in C Which mechanic

More information

EFFECTIVE GI-FI WIRELESS TECHNOLOGY

EFFECTIVE GI-FI WIRELESS TECHNOLOGY INTERNATIONAL JOURNAL OF RESEARCH IN COMPUTER APPLICATIONS AND ROBOTICS ISSN 2320-7345 EFFECTIVE GI-FI WIRELESS TECHNOLOGY M.karthika 1, A.K.SathiyaBama 2 M.Phil. Full Time Research Scholar, Department

More information

Scientific Computing

Scientific Computing Scientific Computing Martin Lotz School of Mathematics The University of Manchester Lecture 1, September 22, 2014 Outline Course Overview Programming Basics The C++ Programming Language Outline Course

More information

LABORATORY MANUAL APPLIED NUMERICAL TECHNIQUES AND COMPUTING LAB. ME 321 F

LABORATORY MANUAL APPLIED NUMERICAL TECHNIQUES AND COMPUTING LAB. ME 321 F LABORATORY MANUAL APPLIED NUMERICAL TECHNIQUES AND COMPUTING LAB. ME 321 F LIST OF EXPERIMENTS APPLIED NUMERICAL TECHNIQUES AND COMP. SR.NO. NAME OF EXPERIMENTS DATE SIGNATURE 1. Solution of Non linear

More information

NCS 301 DATA STRUCTURE USING C

NCS 301 DATA STRUCTURE USING C NCS 301 Data Structure Using C NCS 301 DATA STRUCTURE USING C Unit-1 Part-1 Intro to Data Structures Hammad Mashkoor Lari Assistant Professor Allenhouse Institute of Technolgy www.ncs301ds.wordpress.com

More information