📚 Question Bank Q31 — Programming and Data Structure
Tags
Programming and Data Structure
Q31. Marks: +2.0 UGC NET Paper 2: Computer Sc 23rd August 2024 Shift 1

Consider following C program:

#include < stdio.h >

int main()
{
    int x[] = {2, 4, 6, 8, 10};
    int a, b = 0, *y = x + 4;

    for(a = 0; a < 5; a++) 
    { 
        b = b + (*y - a) - *(y - a);
    }

    printf("%d\n", b);
    return 0;
}

What will be the output of the above C program?

1.4
2.6
3.8
4.10 ✓ Correct
📄 All “Programming and Data Structure” questions across papers
🏷 Change Tag for this Question