adplus-dvertising

Welcome to the Code Optimization MCQs Page

Dive deep into the fascinating world of Code Optimization with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Code Optimization, a crucial aspect of Compiler Design. In this section, you will encounter a diverse range of MCQs that cover various aspects of Code Optimization, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Compiler Design.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Code Optimization. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Compiler Design.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Code Optimization. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Code Optimization MCQs | Page 2 of 2

Explore more Topics under Compiler Design

Q11.
What will be output of the following code?
#include<stdio.h>
int main(){
    printf("%d\t",sizeof(6.5));
    printf("%d\t",sizeof(90000));
    printf("%d",sizeof('A'));
    return 0;
}
Discuss
Answer: (c).8 4 4
Q12.
What will be output of the following c code? ( according to GCC compiler)
#include<stdio.h>
int main(){
    signed x;
    unsigned y;
    x = 10 +- 10u + 10u +- 10;
    y = x;
    if(x==y)
         printf("%d %d",x,y);
    else if(x!=y)
         printf("%u  %u",x,y);
    return 0;
}
Discuss
Answer: (a).0 0
Q13.
What will be output of the following c code?
#include<stdio.h>
int main(){
    const int *p;
    int a=10;
    p=&a;
    printf("%d",*p);
    return 0;
}
Discuss
Answer: (b).10
Q14.
What will be output of the following c code?
#include<stdio.h>
int main(){
    int a= sizeof(signed) +sizeof(unsigned);
    int b=sizeof(const)+sizeof(volatile);
    printf("%d",a+++b);
    return 0;
}
Discuss
Answer: (c).8
Q15.
Which of the following is integral data type?
Discuss
Answer: (b).char
Q16.
What will be output of the following c code?
#include<stdio.h>
int main(){
    volatile int a=11;
Discuss
Answer: (d).Cannot Predict
Q17.
What will be output of the following c code?
#include<stdio.h>
const enum Alpha{
      X,
      Y=5,
      Z
}p=10;
int main(){
    enum Alpha a,b;
    a= X;
    b= Z;
    printf("%d",a+b-p); 
    return 0; 
}
Discuss
Answer: (a).-4
Q18.
Which Grammar is it?
S → Aa A → Aab
Discuss
Answer: (b).Left Linear
Q19.
Can Left Linear grammar be converted to Right Linear grammar?
Discuss
Answer: (a).Yes
Page 2 of 2

Suggested Topics

Are you eager to expand your knowledge beyond Compiler Design? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!