What will be the output of
x++ + ++x?

Answer Posted / naveenkumari

here we can see two types of increments pre and post
increment . since x++ is post increment first the value is
assigned and then increments but in case of ++x first the
value is incremented and then assigned since x is not
initialized with any value the above expression gives a
garbage value .For example if x is initialized with a value
"1" then the this expression gives the output as "3"

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between %d and %i in c?

684


Explain the difference between call by value and call by reference in c language?

637


What is modeling?

634


Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer

3831


Why #include is used in c language?

586






Write a program to find the biggest number of three numbers in c?

584


What are the three constants used in c?

538


What is mean by data types in c?

545


How can I dynamically allocate arrays?

583


What is the difference between #include

and #include “header file”?

542


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1312


Can include files be nested? How many levels deep can include files be nested?

649


What is the use of the function in c?

592


how logic is used

1491


What is a null pointer in c?

587