#include
int i.j,temp;
int main () {
i=3;
j=5;
temp = i;
i = j;
j = i;
printf("i=%d j=%d\n",i,j);
printf("%d %d\n",i,j);
}
where i am went wrong.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Aug 8, 2012, 12:57 AM EDT
int i.j,temp;
it should compile OK.
However, if you're wanting to swap the values of i and j so that they become 5 and 3 respectively then you'll need to alter the code to:
Nattudurai EswaramurthyRank #5,536 · 296 reputationPosted Aug 7, 2012, 11:10 PM EDT