#include<stdio.h>
int main()
{
int i=2;
int j=++i + ++i + i++;
printf("%d\n",i);
printf("%d\n",j);
}
Answers were Sorted based on User's Feedback
Answer / vivek patel
it give warning...........
because fun should have return type...
first i=2
then ++i so i=3 and j=3+ ++i + i++
then ++i so i=4 and j=3 + 4 + i++;
then i++ so i=5 and j=3 + 4+ 5;
so i=5 and j=12;
there is no more diff between i++ and ++i in run time..
it gives same ans....
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / ashok reddy
intially i=2
j=++i + ++i + i++;
in this statament it calculates from r-l
so j=5+4+2
and the last value of i is 5
so i=5 and j=11
is the correct answer
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nb
i = 2 (i dont change)
j = 6 (++i = 3 and in i++ increments after calculating j )
Is This Answer Correct ? | 1 Yes | 6 No |
Given a string write a program to print all alphabetical characters in the order of their occurance first,followed by the sum of the numeric characters then followed by the special characters in the order of their occurance.
1 Answers College School Exams Tests, Wipro,
What's wrong with "char *p; *p = malloc(10);"?
How to find the usage of memory in a c program
Explain the term printf() and scanf() used in c language?
WAP that prints the number from 1 to 100. but for multiplies of three print "XXX" instead of the number and for the multiplies of five print "YYY" . for number which are multiplies of both three and five print "ZZZ"
What is the use of a semicolon (;) at the end of every program statement?
What is conio h in c?
Write a program to print fibonacci series using recursion?
what is the meaning of 'c' language
Explain how can I open a file so that other programs can update it at the same time?
main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }
What is malloc calloc and realloc in c?