#include<stdio.h>
main()
{ int i=5;
printf("%d",i*i-- - --i*i*i++ + ++i);
}
tell the answer with correct reason .specially reason is
important nt answer
ans by turbo c is -39
Answer / myname
It it not an easy question.
After investigating it a little bit, I would say:
- It is undefined behaviour, since "i" is being modified more than once between two sequence points.
- I bet that the turbo c answer is not -39, but -34 (5*5 - 4*4*4 + 5) = -34 (not important, anyway, since any other compiler can reorder the operations and give you any other result since, as I have previously said, it is undefined behaviour).
Is This Answer Correct ? | 0 Yes | 0 No |
how to TOGGLE Nth bit of variable in a MACRO
write a program in C to swap two variables
What is string function c?
What is a dynamic array in c?
what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year
Question 1: You want to conduct a survey within your classroom, on the quality of canteen’s food. You ask each of your class fellows to rank the quality of food between 1 and 5 (1 representing excellent quality and 5 representing worst quality). During the survey, you make a list containing the roll# of student and the opinion given by that student. The list can be as follow Roll # Opinion 234 1 235 1 236 5 237 1 238 2 239 3 240 5 241 5 242 1 To get the results of the survey, you need to determine the frequency of each opinion value. The frequency of an opinion is determined by counting the number of students giving that opinion. For example, for the above list the frequency of opinion value 1 is 4 and frequency of opinion value 4 is 0. After getting the frequency of each opinion, you can easily judge about the quality of the food by seeing through the frequency of each opinion. You need to develop a program to calculate the results of this survey. The program inputs the opinion of 50 students and counts the frequency of each opinion. It then displays a report showing the frequency of each opinion. Sample output: Opinion Frequency Remarks 1 5 Excellent 2 10 Good 3 15 Normal 4 10 Bad 5 10 Really bad
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
How pointers are declared?
#include<stdio.h> int main() { int a[3][3][2]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}; printf("%d\n",*(*(*a+1)); return 0; } What will be the output of the above question? And how?
Explain that why C is procedural?
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
11 Answers CISOC, CitiGroup, College School Exams Tests,
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x?
16 Answers Accel Frontline, Opera, Oracle,