You are on page 1of 17

Section A Q1)

(Marks: 2 each)

a) What is SDRAM? Ans : SDRAM (synchronous DRAM) is a name for various kinds of dynamic random access memory (DRAM) that are synchronized with the clock speed that the microprocessor is optimized for. This tends to increase the number of instructions that the processor can perform in a given time. The speed of SDRAM is rated in MHz rather than in nanoseconds (ns). b) What is the difference between CDROM and CDR/W? Ans: CD-ROM is a compact disc that contains data accessible to, but not writable by, a computer for data storage and music playback. CD-ROMs are popularly used to distribute computer software, including games and multimedia applications, though any data can be stored. Through CD-ROM we can read data but not write data to the CD.

CDRW (Compact Disc Re-Writable) refers to a recordable CD which allows the data to be overwritten numerous times. Short for CD-Rewritable disk, a type of CD disk that enables you to write onto it in multiple sessions. One of the problems with CD-R disks is that you can only write to them once. With CD-RW drives and disks, you can treat the optical disk just like a floppy or hard disk, writing data onto it multiple times. c) What is spellCheck in Windows used for? Ans Word offers a Spelling Check in the Tool Menu. This feature is not only highly efficient
but also extremely fast. The Spell Check feature has become an essential feature in all modem days word processors. This feature greatly reduces the pain involved in checking a document for errors. It should be understood that the Spell Check can only find error when it locates a word in which does not exist in the dictionary.The short cut key for Spell Check is F7.

d) What is USB port in Computers used for? Ans: USB stands for Universal Serial Bus, an industry standard for short-distance digital data communications. USB allows data to be transferred between devices. USB ports can also supply electric power across the cable to devices without their own power source. These USB connectors let you attach everything from mice to

printers to your computer quickly and easily. The operating system supports USB as well, so the installation of the device drivers is quick and easy, too.

e) What is the role of Friend Functions? Ans: A friend function is a special function in c++ which in spite of not being member function of a class has privilege to access private and protected data of a class. Class can allow non-member functions and other classes to access its own private data, by making them friends. Thus, a friend function is an ordinary function or a member of another class. f) What is the role of object in C++? Ans : Role of an object is to access the member functions and variables in Classes. An object is a component of a program that knows how to perform certain actions and to interact with other pieces of the program. Functions are just as "black boxes" that take an input and spit out an output. Objects can be thought of as "smart" black boxes. That is, objects can know how to do more than one specific task, and they can store their own set of data. Designing a program with objects allows a programmer to model the program after the real world. A program can be broken down into specific parts, and each of these parts can perform fairly simple tasks. When all of these simple pieces are meshed together into a program, it can produce a very complicated and useful application. g) What is the use of Constructors? Ans: A member function with the same name as its class is a constructor function. Constructors cannot return values. If a class has a constructor, each object of that type is initialized with the constructor prior to use in a program. In short Constructor enables an object to initialize itself when it is created. It is called Constructors because it constructs the values of data members of the class. h) What do you meant by precedence rule of evaluation of expressions? Ans: The precedence rules of evaluation of expressions specify which operator is evaluated first when two operators with different precedence are adjacent in an expression. Adjacent operators are separated by a single operand. The convention needed to clarify which operator should be applied first is known as a precedence rule or, more informally, order of operation. For example, the rule for evaluating (3 + 3 * 2) in mathematics and in most computer languages is to do the multiplication first, so the correct answer is 9. i) What the difference is between structured and an object oriented language? Ans:

1) The main difference between both is in structured programming the flow of program execution is based on the structure of the program written but in Object Oriented Programming the program basic entity is object, object is created which help in execution of the program. 2) In Structured Language there is more dependency between the variables and the program like a chain, whereas in OOPs it is even though dependent still its modular.

3) Structured Language is command line friendly OOPs is user(Developer) friendly.

j) What is the difference between High level and Low level Language? Ans: A high-level programming language is a programming language that, in comparison to low level programming language may be more abstract, easier to use, or more portable across platforms. High level programming languages are more structured and are more intuitive than low level languages. Higher level languages are also easier to read and can typically sometimes work on many different computer operating systems. Some examples of higher level languages are Java, Visual Basic, COBOL, BASIC, C++, and Pascal to name only a few. Lower level languages are typically assembly languages that are machine specific.

Section-B
(Marks: 8 Each) Q2) What is the difference between Primary and Secondary memory storage of a Computer. Where Rom memory is typically found? Ans: The primary memory or the main memory is part of the main computer system. The processor or the CPU directly stores and retrieves information from it. This memory is accessed by CPU, in random fashion. That means any location of this memory can be accessed by the CPU to either read information from it, or to store information in it. The primary memory itself is implemented by two types of memory technologies. The first is called Random Access Memory (RAM) and the other is read only memory (ROM). A more appropriate name for RAM is RWM (Read Write Memory), the CPU can write and read information from any primary memory location implemented using RAM. The other part of primary memory is implemented using ROM which stands for Read Only Memory. Primary memory is much faster and also it is more cost effective. It contains following parts: 1) RAM (Random Access Memory)

2) ROM (Read Only Memory) Pronounced as ramm, acronym for random access memory, a type of computer memory that can be accessed randomly; that is, any byte of memory can be accessed without touching the preceding bytes. RAM is the most common type of memory found in computers. There are two different types of RAM: SRAM (Static Random Access Memory). DRAM (Dynamic Random Access Memory) Now these 2 RAMs can be described as -

SRAM- (static RAM) It is random access memory (RAM) that retains data bits in its memory as long as power is being supplied. Unlike dynamic RAM (DRAM), which stores bits in cells consisting of a capacitor and a transistor, SRAM does not have to be periodically refreshed. Static RAM provides faster access to data and is more expensive than DRAM. Architecture of SRAM is much more complex than that of DRAM. SRAM is much faster as compared to DRAM.

DRAM- (Dynamic RAM) Dynamic random access memory (DRAM) is a type of random access memory that stores each bit of data in a separate capacitor within an integrated circuit. It needs to be refreshed thousands of times per second while SRAM does not need to be refreshed, which is what makes it faster than DRAM. DRAM supports access times of about 60 nano seconds. Despite SRAM being faster, it's not as commonly used as DRAM because it's so much more expensive. Both types of RAM are volatile, meaning that they lose their contents when the power is turned off. The advantage of DRAM is its structural simplicity: only one transistor and a capacitor are required per bit, compared to four transistors in SRAM.

Secondary Memory:
The secondary memory is much slower and also less costly. It stores the data permanently unless it is erased. The secondary memory is usually available in the form of floppy disk storage media, hard disk, CD, DVD, Pen drive (i.e. Mass storage devices), memory chips. A 5 and1/4 inch floppy disk typically stores 1.44 mb of data. The data on the floppy disk is organized in terms of tracks and sectors. Hard disk

can have large capacity something like 80-300 GB's or higher. Hard disk itself is made up of, large number of platters. Hard disk is usually much faster compared to floppy disk. CD can store up to 750 mb of data. Information on CD ROM is organized in terms of a spiral track. A DVD is digital Versatile Disk and can store 4.6 Gigabyte of information. Different type of Secondary Devices is 1) Floppy disk A soft magnetic disk. It is called floppy. Unlike most hard disks, floppy disks (often called floppies or diskettes) are portable, because you can remove them from a disk drive. Disk drives for floppy disks are called floppy drives. Floppy disks are slower to access than hard disks and have less storage capacity, but they are much less expensive. And most importantly, they are portable. Floppy disks are a storage medium made of a thin magnetic disk. Storage capabilities ranged from 1.5 Mb to 200 MB on some versions. Floppies come in three basic sizes 8 inch, 5-inch and 3-inch.

2) Hard disk It is a non volatile storage device. The term hard is used to distinguish it from a soft, or floppy, disk. Hard disks hold more data and are faster than floppy disks. A hard disk, for example, can store anywhere from 10 to more than 300 gigabytes, whereas most floppies have a maximum storage capacity of 1.4 megabytes. Single hard disk usually consists of several platters. Each platter requires two read/write heads, one for each side. All the read/write heads are attached to a single access arm so that they cannot move independently. Each platter has the same number of tracks, and a track location that cuts across all platters is called a cylinder.

3) CD Compact disc known as CD. It is an Optical Disc used to store the data. These types of compact disc are read-only, which means that once the data has been recorded onto them, they can only be read, or played.It is a small plastic disc used for the storage of digital data. As originally developed for audio systems, the sound signal is sampled at a rate of 44,100 times a second, then each sample is measured and digitally encoded on the 43/4 in (12 cm) disc as a series of microscopic pits on an otherwise polished surface. The disc is covered with a transparent coating so that it can be read by a laser beam. Since nothing touches the encoded portion, the CD is not worn out by the playing process. Usually Capacity of CD is of 700 to 750mb.

4) Magnetic Tape Magnetic tape has been in use for more than 50 years.. The average amount of storage is 5 MB to 140 MB for every standard-length reel (2,400 feet).A magnetically coated strip of plastic on which data can be encoded. Tapes for computers are similar to tapes used to store music. Storing data on tapes is considerably cheaper than storing data on disks. Tapes also have large storage capacities, ranging from a few hundred kilobytes to several gigabytes. Accessing data on tapes, however, is much slower than accessing data on disks. Tapes are sequential-access media, which means that to get to a particular point on the tape, the tape must go through all the preceding points. In contrast, disks are random-access media because a disk drive can access any point at random without passing through intervening points. Because tapes are so slow, they are generally used only for long-term storage and backup. Data to be used regularly is almost always kept on a disk. Tapes are also used for transporting large amounts of data.

b) Every motherboard has a Rom chip on it. Typically, the one most noteworthy is the Rom chip that holds the information for the motherboard. It carries boot instructions, the setup program, BIOS programs, and POST routine. This chip is usually not altered. Older motherboards carried removable ROM chips that could be replaced, but are now mostly onboard or soldered on permanently. ROM (read-only memory) chips are installed on a computer's motherboard. The model of the board usually determines the type of ROM needed to control a computer's boot routine. ROM is often called "non-volatile memory," meaning that an electrical current is not needed to maintain the pre-recorded data instructions on the chip. The instructions cannot be overwritten, and only special equipment can be used to rewrite or erase the data. Q3) What is Control Panel used for in Windows? Why is disk Fragmentation done in Windows? Ans: Control Panel is the most important thing in window through which we can perform various tasks some of the most important uses of Control Panel can be shown as :

1)

Accessibility - Five tabs are keyboard, sound (Can have visible sound indications), display, mouse(Can move the mouse with the keyboard), and general (alternatives to keyboard and mouse).

2)

Add/Remove Hardware - Can add and remove hardware device drivers for display devices, CDROM and DVD drives, I/O devices (Keyboard, mouse, USB devices and more), Mobile computer hardware, modems, multimedia, and network cards. A device driver is a software3 program that allows the system to interact with hardware. If the driver is signed, it has a digital signature from its creator verifying its authenticity.

3)

Administrative Tools - Only the members of the Administrators group can use these tools.

4)

Date/Time We can check the Date/Time status in Control Panel.

5)

Display - Tabs are Background, Screen Saver, Appearance, Web, Effects, and Settings( Sets the video mode). The Screen saver allows power settings to be adjusted along with selection of the screen saver. Appearance tab adjusts the Windows color schemes. The Web tab allows a specific web page to be displayed all the time on the desktop. The effects tab allows desktop icons to be changed. The Settings tab allows screen size and colors to be changed.

6)

Fonts - Allows viewing of current fonts and installation of new fonts. It is a shortcut to the fonts folder.

7)

Game Controllers- Allows configuration of joysticks and gamepads.

8)

Internet Options - These are options for Internet Explorer. They can be accessed from the Tools menu of IE. Tabs include General (Control of temporary files, history, and home page), Security (Allows trusted site settings, cookie settings, JavaScript settings and more), Content (Allows certificates, and storage of private information),

Connections, Programs (Specification of programs for e-mail, HTML editing, newsgroups, and more), and Advanced tabs(JavaScript debugging options, HTML versions and more).

9)

Keyboard - Includes Speed, Input Locales (assign hotkeys), and Hardware (physical type of keyboard) tabs.

10)

Mouse and mouse pointer settings including mouse speed - Tabs include, Buttons (to set right or leeft handed mouse), Motion (speed), Pointers (Selection of mouse icons for normal, waiting, and other states), and Hardware (Sets up the mouse type such as PS2 Intellimouse and options available in the Device Manager).

11)

Network and Dial-up Connection - Can change computer name, and set to workgroup or domain. bindings are set here with the first one on the list to be the first one tried when services are attempted to be used. Also used to install NIC drivers. Tabs are: a) Identification - computer name and domain or workgroup name b) Services - Can add, or remove services and check their properties. c) protocols - Can add or remove protocols or check their setup (properties). d) Adapters - Add or remove NIC adapter drivers. e) bindings - Where the binding priority may be set for various services.

12)

Phone and Modem Options - Modem properties and dialing rules are configured here.

13)

Power Options - Settings for how long hard drives and the monitor stays on are configured here. Tabs are "Power Schema", "Advanced", "Hibernate", "APM", and "UPS". The Power Schema tab controls how long of a period of inactivity to wait before turning off the monitor and hard drives. The Advanced Power Management (APM) tab controls older power management for laptops. The UPS tab is used to configure commands to execute when a UPS event occurs.

14)

Printers - Allows addition and deletion of printers. Right clicking and selection properties for a specific printer, opens a properties window with General (Driver

Selection, Separator page, print processor [RAW, text], print test page), ports, Scheduling (priority, When printing starts relative to spooling, Hours of availability), Sharing, Security, and About tabs.

15)

Regional Options - Set up regional and language settings for NT. Select General, Numbers, Currency, Time, Date, or Input Locales tabs. The Regional Options tab is used to add additional language support.

16)

Scanners and Cameras - Digital cameras and scanners may be installed and configured here.

17)

Scheduled Tasks - Also called the "Task Scheduler", it is used to schedule programs or scripts to run at specific times. An "Add Scheduled Task" icon is in this folder.

18)

Sounds and Multimedia - Used to setup sound schemes and sounds to play for specific events. Tabs are "Sounds", "Audio", and "Hardware". The Sounds tab is used to associate events and sounds. The Audio tab allows the device to use for playing and recording sound to be set. The Hardware tab is used to configure and view multimedia devices.

19)

System a) General - Describes the name and version of the system, who it is registered to and the hardware it is running on. b) Network Identification - Allows the changing of the computer name, workgroup, or domain. c) Hardware - Allows selection of hardware profiles and what to do if the system cannot determine which profile to use. Includes Hardware Wizard, Device Manager, and Hardware Profiles sections. The Hardware Profiles section allows additional hardware profiles to be created. The Device Manager section includes a Device Manager and a Driver Signing button. The Device signing allows configuration of what to do when system files are not digitally signed. Options are Ignore, Warn, or Block. Sigverif command line utility is used to find unsigned files on the computer. Sfc.exe command line utility is used to replace any unsigned files with the original Microsoft version from the SystemRoot\System32\Dllcache directory. The device manager includes the ability to configure:

i) Computer - Used to configure for multiple ii) Disk drives iii) Display adapters iv) DVD/CD-ROM drives v) Floppy disk controllers vi) Floppy disk drives vii) IDE ATA/ATAPI controllers viii) Imaging devices ix) Infared devices x) Keyboards xi) Mice and other pointing devices xii) Modems xiii) Monitors xiv) Network adapters xv) PCMCIA adapters - (Card Services)

processors.

b)
Disk fragmentation is a common and severe problem yet few people are aware of this. It greatly reduces the speed and reliability of the computer. Disk fragmentation may be the primary reason of a slow computer. Consider your hard disk as a cabinet where you store files in alphabetical order as you can easily found the files when needed. But when you pull out or add some more files then this order may not be maintained. So it becomes difficult to find files afterwards and it is also becomes a time consuming process. Hard disk is similar to this cabinet. In hard disk also, when you add more programs, games, or any other files, delete some files, and add new ones again, then computer takes a lot of time to find files which you want to open although the files are still on hard disk. Fragmentation becomes more severe when you continue adding and deleting files on computer. Q4) How is mail merge useful? How can we use fields from excel file to merge in a word documents also?
Ans:

Mail Merge is a very important, useful and powerful addition to the primarily feature of WORD, word processing. You can use Mail Merge to print personalized form, letters (bearing the addressees name and address on the letter), envelopes, mailing labels etc. The form letters are those letters that have the same (or nearly same) contents. These letters are sent to several persons. Business letters describing the launch of a new product, call letters for interview, notice for a meeting, invitation for a party, are examples of form letters. In these letters, the text is the same (or nearly the same) and only the addressees name, designation, address and a few other details differ. When no computer is used to send form letters, one normally gets the letters printed, cyclostyled or photocopied, and a then manually write/types the name and

address on letters and/or envelopes. One can use WORD for this kind of application. One way of printing similar letters of kind discussed above is to first type a letter and then prints it. Then, we can edit it and change the name, address and other details for the next letter and prints it, and so on. Obviously, this is a very cumbersome method. However, with Mail Merge, things are not so difficult and cumbersome. The name, designation, address, etc. that differ from one letter to another are stored in another file. The Mail Merge of WORD merges (combines) the two files at the time of printing. Since this is used to print letters for mailing it is called Mail Merge. The main steps in Mail merge is shown below. Mail merge is mainly divided into 6 steps as shown Step 1: Select document type Step 2: Select starting document Step 3: Select recipients Step 4: Write Your Letter Step 5: Preview your letters Step 6: Complete the merge

b)
The mail merge tool in Microsoft Word allows you to print a series of standard letters or documents with particular details (such as names and addresses) changed on each one. The details which are to be merged into each letter are typically read from an external file such as an Excel spreadsheet. Ensure that the data in Excel is in a single table (i.e. a continuous range). If there is one single table of data located on a worksheet, the Word wizard will be able to easily identify it. Note that the mail merge wizard and tools may differ slightly in different versions of Word. Within Word create the outline of a letter which you wish to reprint many times with different field variables. Leave spaces where you wish to add field variables. Start the Word Wizard using the menu option: Tools | Letters and Mailings | Mail Merge ... It will then guide you through 6 steps of linking the data and inserting the fields. When you are prompted to select recipients, choose the option to browse for an existing list. Select the appropriate spreadsheet from the Dialog box and the worksheet containing the table. Note that it is important to identify whether or not the first row of the table contains field names. Place the cursor in your document where you wish to insert a field. Although Word offers some potentially useful tools for compiling address or greeting line blocks, it is relatively simple to use the More Items ... option. This will allow you to pick from your list of field variables and drop it into your document. Repeat this with each of the field variables. The mail merge process can leave you with fields in unexpected formats. Numbers may appear with lots of additional decimal places due to the peculiar way in which

Excel handles values. Dates may be have the month and days in the wrong order (depending on Windows international settings) and you may wish to include weekday or month names rather than numbers. The steps to performing a mail merge are: 1. 2. 3. 4. Compose or gather the data in your external data source. Attach the data source to your template document. Compose your template document. Merge in the external data.

Q5 Write a program to copy the contents of one file into other using command line arguments. How are binary files different from text files in CPP?
Ans: /* Program to copy the contents of one file to other */

#include<fstream.h> #include<conio.h> void main(int a,char arg[]) { clrscr( ); char ch; fstream f1, f2; f1.open(arg,ios::out); cout<<a; f1<<"My school is Carmel Convent\n"; f1<<"It is in Delhi"; f1.close(); f1.open("Firs.txt",ios::in); f2.open("Second.txt",ios::out); while(f1.get(ch)) { cout<<ch; f2.put(ch) ; } getch(); }

b)
.txt is a filename extension for files consisting of text usually containing very little formatting (ex: no bolding or italics). The precise definition of the .txt format is not specified, but typically matches the format accepted by the system terminal or simple text editor. Files with the .txt extension can easily be read or opened by any program that reads text and, for that reason, are considered universal (or platform independent). When you access a file from within C or C++ you have a choice between treating the file as a binary file or as a text file.C++ uses the fopen (file,mode) statement to open a file and the mode identifies whether you are opening the file to read, write, or append and also whether the file is to be opened in binary or text mode. C++ opens a file by linking it to a stream so you don't specify whether the file is to be opened in binary or text mode on the open statement. Instead the method that you use to read and/or write to the file determines which mode you are using. If you use the << operator to read from the file and the >> operator to write to the file then the file will be accessed in text mode. If instead you use the put() and get() or read() and write() functions then the file will be accessed in binary mode. Well the difference is that text files contain lines (or records) of text and each of these has an end-of-line marker automatically appended to the end of it whenever you indicate that you have reached the end of a line. There is an end of line at the end of the text written with the C fwrite() function or in C++ when you <<endl. Binary files are not broken up into separate lines or records so the end-of line marker is not written when writing to a binary file. Reading from a text file or binary file is different too as a text file is automatically broken up into separate records as it read in based on the location of the end-of-line markers. Section-C

Q6) What do you understand by Inheritance? Give its various types and access mechanisms. What are the advantages of scope resolutor & referencing? Ans:
Inheritance is the process by which a new classes called derived classes are created from the existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived classes. For example, a programmer can create a base class named fruit and define derived classes as mangoes, oranges , apples etc. Each of these derived classes has all the features of the base class with additional features of the derived class as well.

Benefits of Inheritance 1) Reusability 2) Saves time and efforts 3) Increases program structure which results in greater reliability.

b) Friend class and Inheritance (Friendship and Derivation)


Basically, we can distinguish Friend class and derived class as follows: Friend class can access all the members of the class, even private members, in which it is declared as friend class. Whereas derived class can access only public and protected members of the base class. Friend class can access all the member of the other class, in which it is declared as friend, with the object of that class. Whereas derived class can directly access public and protected members of the base class. Friend class does not inherit the properties of the other class. Specifically, the members of the first class do not become members of the friend class. However the members of the base class become members of the derived class. It means, when we create object of friend class, it will not get memory space for the data members of other class. But if we create object of derived class, it will get memory space for all the data members of base class. Consider the following program of friend class, in which we are accessing the private data member of other class using its object: 1. #include<iostream.h> 2. #include<conio.h> 3. class A 4. { 5. int a; 6. protected: 7. int b; 8. public: 9. int c; 10. friend class B; 11. public: 12. A() 13. { 14. a=10; 15. b=20; 16. c=30; 17. } 18. }; 19. class B 20. {

21. public: 22. void showA() 23. { 24. A obj; 25. cout <<"\na="<<obj.a; // we can access all data member of Class A, only with its 26. cout<<\nb=<<obj.b; // Object 27. cout<<\nc=<<obj.c; 28. } 29. }; 30. void main() 31. { 32. clrscr(); 33. B objB; 34. objB.showA(); 35. } - See in line 25,26 and 27 we have accessed data members of class A but only with the object of class A because members of Class A does not become the members of class B (friend of class A). Consider the same program using inheritance: 1. #include<iostream.h> 2. #include<conio.h> 3. class A 4. { 5. int a; 6. protected: 7. int b; 8. public: 9. int c; 10. public: 11. A() 12. { 13. a=10; 14. b=20; 15. c=30; 16. } 17. }; 18. class B : public A 19. { 20. public: 21. void showA() 22. { 23. //cout <<"\na="<<a; we cant access private data of base class 24. cout<<\nb=<<b; // we need not to use object of base class 25. cout<<\nc=<<c; 26. } 27. }; 28. void main() 29. { 30. clrscr(); 31. B objB;

32. objB.showA(); 33. } - See in line 24 and 25 we have accessed data members of class A without the object of class A because members of Class A become members of class B. But we cannot access private members of A in B. Now consider the following program in which we have declared derived class as friend in base class. 1. #include<iostream.h> 2. #include<conio.h> 3. class A 4. { 5. int a; 6. protected: 7. int b; 8. public: 9. int c; 10. friend class B; 11. public: 12. A() 13. { 14. a=10; 15. b=20; 16. c=30; 17. } 18. }; 19. class B : public A 20. { 21. public: 22. void showA() 23. { 24. cout <<"\na="<<a; //we can access private data too, without the object of A 25. cout<<\nb=<<b; 26. cout<<\nc=<<c; 27. } 28. }; 29. void main() 30. { 31. clrscr(); 32. B objB; 33. objB.showA(); 34. } In the above program, class B is both derived and friend class of Class A. So member functions of class B can access all the member of class A without As object.

c) A scope resolution operator (::), can be used to define the member functions of a class outside
the class. You can tell the compiler to use the global identifier rather than the local identifier by prefixing the identifier with: the scope resolution operator. : identifier Class-name: identifier Namespace: identifier

The identifier can be a variable or a function. If you have nested local scopes, the scope resolution operator does not provide access to identifiers in the next outermost scope. It provides access to only the global identifiers. Example This example has two variables named amount. The first is global and contains the value 123. The second is local to the main function. The scope resolution operator tells the compiler to use the global amount instead of the local one.

#include<iostream.h> #include<conio.h> int amount=12; void main() { int amount=78; cout<<::amount<<\n; getch(); } Output will be 12 because it will pick the value declared above main function.

You might also like