Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Can anyone tell me to execute the code of y = ++ x when x = 3, please tell me all how to write it if you can
+1
vote
asked
Dec 13, 2019
by
anonymous
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
5 Answers
0
votes
answered
Dec 16, 2019
by
Zayn
(
140
points)
while(x==3)
y=++x;
According to your question this is the solution. Otherwise kindly explain your question further more
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Dec 17, 2019
by
vetri
#include<stdio.h>
int main()
{
int a, b;
a = 5;
b = ++a;
printf ("data after pre-increment is %d ",b);
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Dec 17, 2019
by
Erik
I'm guessing you are looking for this
if(x==3)
{
y = ++x;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Dec 17, 2019
by
Prakash Rockez
(
260
points)
#include <stdio.h>
int main()
{
int x,y;
x=3;
y=++x;
return 0;
}
output:
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Dec 17, 2019
by
Prakash Rockez
(
260
points)
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x,y;
x=3;
y=++x;
return 0;
}
output:
commented
Dec 18, 2019
by
coinhawk crypto
(
100
points)
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x, y;
x = 3;
printf("this is x %d ", x);
y = ++x;
printf("this is y %d ", y);
printf("this is y %d ++x %d ", y, x);
// keep in mind ++ can be before or after, the variable
// it will determine when the calculations take place
return 0;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...