Skip to main content

Type Declaration Instruction:



This instruction is used to declare the type of variables being used in the program. A variable is a location in RAM (main memory) for temporary storage of intermediate data.
Any variable used in the program must be declared before using it in any statement. The type declaration statement is written at the beginning of main() function.

Ex:       int bas;
            float  rs, grosssal;
char  name, code;

These are several subtle variations of the type declaration instruction.

i) While declaring the type of variable we can also initialize it as shown below:

int i=10, j=25;
float a=1.5, b= 1.99+2.4 * 1.45 ;
ii)  The order in which we define the variables is sometimes important sometimes not.
      For exa:

            int i=10,j=20;

is same as
            int j=20, i=10;

However,

float a =1.2, b=a+3.1;
is alright, but

float b=a+3.1, a=1.2;

is not.this is because here we are trying to use a even before defining it.

iii) Similarly
            int a,b,c,d;
            a=b=c=10;
            is O.K. but

            int a=b=c=d=10;

            will not work.( find out why ???)

Popular posts from this blog

Cognizant Company Profile and it's information for Interview

Website: www.cognizant.com HQ Teaneck, NJ Industry Information Technology Services Size 130K+ Employees, $6B+ Revenue NASDAQ CTSH Competitors Infosys, Wipro, Tata Consultancy Services   About cognizant Cognizant Corporate view: Cognizant is an American multinational IT services and consulting corporation headquartered in Teaneck, New Jersey, United States. Cognizant has been named to the 2010 Fortune 100 Fastest-Growing Companies List for the eighth consecutive year. Cognizant has also been named to the Fortune 1000 and Forbes Global 2000 lists. It has consistently ranked among the fastest growing companies including the 2010 Business Week 50 list of the top-performing U.S. companies, the Business Week Hottest Tech Companies 2010, and the Forbes Fast Tech 2010 list of 25 Fastest Growing Technology Companies In America. Founded: 1994 Headquarters: Teaneck, New Jersey, U.S. Key people:  Francisco D'Souza (President & CEO) Lakshmi Naray...

CIVIL SERVICES' (I.A.S.) EXAMINATION

The Union Public Service Commission (U.P.S.C.)  conducts Civil Services' Examination once a year in two stages. The Preliminary Examination (Objective Type) for selection of candidates for the Main Examination is held in the month of May. The Civil Services Main Examination  is held in the months of October/November. Blank application forms and other particulars are published in the Employment News, generally in the month of December. The last date for the submission of applications to the Secretary, Union Public Service Commission, Dholpur House, Shahjahan Road, NewDelhi-11001 1 is usually the last week of January of the year of examination. The Combined Civil Services Examination is conducted for Recruitment to the following Services/Posts: 1. Indian Administrative Service. 2. Indian Foreign Service. 3. Indian Police Service. 4. Indian P & T Accounts & Finance Service, Group 'A'. 5. Indian Audit and Accounts Service, Group 'A'. 6. Indian Customs and Centr...

Infosys delays 17,000 campus recruitment offers

Bangalore: With a challenging environment, and low visibility into client spend, Infosys has said that it will be deferring joining dates, and the management is also putting some cost saving measures in place, reports Shreya Roy of CNBC-TV18. Infy had decided that with its current business needs in mind it will defer its campus recruitment process. The company had initially made 27,000 campus offers, but now the company says that 17,000 of these will be deferred by up to three months. However, the firm has reiterated that it plans to honour each of these offers in due course of time. In fact the company which prided itself on a six-month long extensive training programme for fresh intakes has also decided to cut the period short by two months, four months of this training programme will be conducted at its sprawling Mysore campus, while two months will be an online programme. With a challenging environment, and low visibility into client spend, Infy said it will delay...