adplus-dvertising

Welcome to the Control Flow Statements in C MCQs Page

Dive deep into the fascinating world of Control Flow Statements in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Control Flow Statements in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Control Flow Statements in C, 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 C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Control Flow Statements in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

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

Control Flow Statements in C MCQs | Page 10 of 32

Q91.
goto can be used to jump from main to within a function
Discuss
Answer: (b).false
Q92.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        printf("%d ", 1);
        goto l1;
        printf("%d ", 2);
        l1:goto l2;
        printf("%d ", 3);
        l2:printf("%d ", 4);
   }
Discuss
Answer: (a).1 4
Q93.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        printf("%d ", 1);
        l1:l2:
        printf("%d ", 2);
        printf("%d\n", 3);
    }
Discuss
Answer: (b).1 2 3
Q94.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        printf("%d ", 1);
        goto l1;
        printf("%d ", 2);
    }
    void foo()
    {
        l1: printf("3 ", 3);
    }
Discuss
Answer: (d).Compile time error
Q95.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int i = 0, j = 0;
        while (i < 2)
        {
            l1: i++;
            while (j < 3)
            {
                printf("loop\n");
                goto l1;
            }
        }
   }
Discuss
Answer: (d).Infinite loop
Q96.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int i = 0, j = 0;
        while (l1: i < 2)
        {
            i++;
            while (j < 3)
            {
                printf("loop\n");
                goto l1;
            }
        }
   }
Discuss
Answer: (b).Compile time error
Q97.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int i = 0, j = 0;
        l1: while (i < 2)
            {
                i++;
                while (j < 3)
                {
                    printf("loop\n");
                    goto l1;
                }
            }
   }
Discuss
Answer: (a).loop loop
Q98.
What is the output of given program if user enter value 99?
#include<stdio.h>
void main()
{
	int i;
	printf("Enter a number:");
	scanf("%d", &i); // 99 is given as input.
	if(i%5 == 0){
		printf("nNumber entered is divisible by 5");
        }
}
Discuss
Answer: (a).Enter a number:99
Q99.
What is the output of given program if user enter "xyz" ?
#include
void main()
{
	float age, AgeInSeconds;
	printf("Enter your age:");
	scanf("%f", &age);
	AgeInSeconds = 365 * 24 * 60 * 60 * age;
	printf("You have lived for %f seconds", AgeInSeconds);
}
Discuss
Answer: (b).Enter your age: xyz You have lived for 0.00000 seconds
Q100.
What is the output of given program if user enter "xyz" ?
#include
void main()
{
	float age, AgeInSeconds;
	int value;
	printf("Enter your age:");
	value=scanf("%f", &age);
	if(value==0){
		printf("\\nYour age is not valid");
	}
	AgeInSeconds = 365 * 24 * 60 * 60 * age;
	printf("\\n You have lived for %f seconds", AgeInSeconds);
}
Discuss
Answer: (c).Enter your age: xyz Your age is not valid

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? 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!