what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}

Answer Posted / r.aruna

answer is 3,2,2
because print the value form right to left.
so,the first one ++i means preincrement.
so,incremented one,2
second one is i++ means postincrement .
it doesn't increment store in same location
but next i means 3.because move to next location

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

simple program of graphics and their output display

1471


What is meant by operator precedence?

680


If I have a char * variable pointing to the name of a function ..

657


When should you use a type cast?

595


writ a program to compare using strcmp VIVA and viva with its output.

1528






Explain built-in function?

595


How can I read and write comma-delimited text?

625


What is c++ used for today?

671


What is a program flowchart?

607


Why do we use null pointer?

609


Array is an lvalue or not?

642


In C programming, what command or code can be used to determine if a number of odd or even?

627


Write a program to maintain student’s record. Record should not be available to any unauthorized user. There are three (3) categories of users. Each user has its own type. It depends upon user’s type that which kind of operations user can perform. Their types and options are mentioned below: 1. Admin (Search Record [by Reg. No or Name], View All Records, Insert New Record, Modify Existing Record) 2. Super Admin (Search Record [by Reg. No or Name], View All Records, Insert New Record, Modify Existing Record, Delete Single Record) 3. Guest (Search Record [by Reg. No or Name], View All Records) When first time program runs, it asks to create accounts. Each user type has only 1 account (which means that there can be maximum 3 accounts). In account creation, following options are required: Login Name: <6-10 alphabets long, should be unique> Password: <6-10 alphabets long, should not display characters when user type> Confirm Password: Account Type: Login Name, Password and Account Type should be stored in a separate file in encrypted form. (Encryption means that actual information should be changed and Decryption means that Encrypted information is changed back to the actual information) If any of the above mentioned requirement(s) does not meet then point out mistake and ask user to specify information again. When Program is launched with already created accounts, it will ask for user name and password to authenticate. On successful authentication, give options according to the user’s type.

1515


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1580


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1747