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.
33 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

Viva Questions

,

study material

,

video lectures

,

Extra Questions

,

practice quizzes

,

shortcuts and tricks

,

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

,

Free

,

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

,

pdf

,

Previous Year Questions with Solutions

,

Exam

,

Important questions

,

Objective type Questions

,

mock tests for examination

,

past year papers

,

Semester Notes

,

ppt

,

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

,

MCQs

,

Sample Paper

,

Summary

;