Database Management Exam  >  Database Management Videos  >  Introduction to Fortran Programming (Basic Level)  >  Fortran Programming Tutorials (Revised) : 037 : Fortran Array Indexing; Printing arrays

Fortran Programming Tutorials (Revised) : 037 : Fortran Array Indexing; Printing arrays Video Lecture | Introduction to Fortran Programming (Basic Level) - Database Management

41 videos

FAQs on Fortran Programming Tutorials (Revised) : 037 : Fortran Array Indexing; Printing arrays Video Lecture - Introduction to Fortran Programming (Basic Level) - Database Management

1. What is array indexing in Fortran programming?
Ans. Array indexing in Fortran programming refers to the process of accessing and manipulating individual elements of an array using their position or index. In Fortran, array indexing starts from 1, unlike some other programming languages that start from 0.
2. How can I print an array in Fortran?
Ans. To print an array in Fortran, you can use a loop to iterate through each element of the array and print its value. Here's an example: ```fortran program print_array implicit none integer :: i integer, dimension(5) :: my_array my_array = [1, 2, 3, 4, 5] do i = 1, size(my_array) print *, my_array(i) end do end program print_array ``` This program will print each element of the `my_array` on a separate line.
3. Can I change the values of an array using array indexing in Fortran?
Ans. Yes, you can change the values of an array using array indexing in Fortran. By assigning a new value to a specific index of the array, you can modify the corresponding element. For example: ```fortran my_array(3) = 10 ``` In this case, the third element of `my_array` will be changed to 10.
4. What happens if I try to access an element of an array using an invalid index in Fortran?
Ans. If you try to access an element of an array using an invalid index in Fortran, it will result in a runtime error. Fortran does not perform index out-of-bounds checking by default, so it is your responsibility to ensure that the index is within the valid range of the array.
5. Can Fortran arrays have negative indices?
Ans. No, Fortran arrays cannot have negative indices. Array indexing in Fortran starts from 1 and goes up to the size of the array. Attempting to use a negative index will result in a compilation error.
41 videos
Explore Courses for Database Management exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Fortran Programming Tutorials (Revised) : 037 : Fortran Array Indexing; Printing arrays Video Lecture | Introduction to Fortran Programming (Basic Level) - Database Management

,

Fortran Programming Tutorials (Revised) : 037 : Fortran Array Indexing; Printing arrays Video Lecture | Introduction to Fortran Programming (Basic Level) - Database Management

,

ppt

,

MCQs

,

study material

,

Previous Year Questions with Solutions

,

Extra Questions

,

Important questions

,

past year papers

,

Summary

,

Objective type Questions

,

pdf

,

Viva Questions

,

Exam

,

practice quizzes

,

Sample Paper

,

Fortran Programming Tutorials (Revised) : 037 : Fortran Array Indexing; Printing arrays Video Lecture | Introduction to Fortran Programming (Basic Level) - Database Management

,

mock tests for examination

,

Free

,

shortcuts and tricks

,

Semester Notes

,

video lectures

;