Database Management Exam  >  Database Management Videos  >  Introduction to Fortran Programming (AdvancedLevel)  >  Advanced Fortran Programming : 012 : More on save (with demo) and optional keywords

Advanced Fortran Programming : 012 : More on save (with demo) and optional keywords Video Lecture | Introduction to Fortran Programming (AdvancedLevel) - Database Management

33 videos

FAQs on Advanced Fortran Programming : 012 : More on save (with demo) and optional keywords Video Lecture - Introduction to Fortran Programming (AdvancedLevel) - Database Management

1. What is the purpose of the "save" keyword in Fortran programming?
Ans. The "save" keyword in Fortran programming is used to specify that the value of a variable should be preserved between different invocations of a subroutine or function. When a variable is defined with the "save" attribute, its value is retained in memory even after the program execution leaves the subroutine or function.
2. How is the "save" keyword used in Fortran programming?
Ans. To use the "save" keyword in Fortran programming, it should be placed before the declaration of a variable in a subroutine or function. This indicates that the variable's value should be saved between successive calls to the subroutine or function. For example, the statement "save :: x" declares the variable "x" with the "save" attribute, ensuring its value is preserved across multiple invocations.
3. Can the "save" attribute be applied to arrays in Fortran programming?
Ans. Yes, the "save" attribute can be applied to arrays in Fortran programming. By specifying "save" before the declaration of an array, the values of the array elements will be preserved between different invocations of a subroutine or function. This is useful when the array needs to retain its values across multiple calls.
4. What is the difference between "save" and "optional" keywords in Fortran programming?
Ans. The "save" keyword in Fortran programming is used to preserve the value of a variable between successive calls to a subroutine or function. On the other hand, the "optional" keyword is used to specify that a subroutine or function argument is not required to be provided by the calling program. It allows the argument to have a default value assigned if it is not explicitly provided.
5. Can the "save" keyword be used with optional arguments in Fortran programming?
Ans. Yes, the "save" keyword can be used with optional arguments in Fortran programming. By applying the "save" attribute to an optional argument, its value will be preserved between different calls to the subroutine or function. This can be useful when the optional argument needs to retain its value across multiple invocations.
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

pdf

,

Advanced Fortran Programming : 012 : More on save (with demo) and optional keywords Video Lecture | Introduction to Fortran Programming (AdvancedLevel) - Database Management

,

past year papers

,

Viva Questions

,

Sample Paper

,

Semester Notes

,

ppt

,

Objective type Questions

,

video lectures

,

Advanced Fortran Programming : 012 : More on save (with demo) and optional keywords Video Lecture | Introduction to Fortran Programming (AdvancedLevel) - Database Management

,

MCQs

,

shortcuts and tricks

,

Important questions

,

Exam

,

practice quizzes

,

study material

,

Previous Year Questions with Solutions

,

Free

,

mock tests for examination

,

Advanced Fortran Programming : 012 : More on save (with demo) and optional keywords Video Lecture | Introduction to Fortran Programming (AdvancedLevel) - Database Management

,

Summary

,

Extra Questions

;