IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C++ Programming C# Programming Java Programming
Microbiology Biochemistry Biotechnology Biochemical Engineering
Civil Engineering Mechanical Engineering Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

C Programming - Control Instructions

@ : Home > C Programming > Control Instructions > Point Out Correct Statements

Exercise

"Time and tide wait for none."
- Alexander Pope
1. 

Which of the following statements are correct about the below program?

#include<stdio.h>
int main()
{
    int i = 10, j = 20;
    if(i = 5) && if(j = 10)
        printf("Have a nice day");
    return 0;
}

A. Output: Have a nice day
B. No output
C. Error: Expression syntax
D. Error: Undeclared identifier if

2. 

Which of the following statements are correct about the below program?

#include<stdio.h>
int main()
{
    int i = 10, j = 15;
    if(i % 2 = j % 3)
        printf("IndiaBIX\n");
    return 0;
}

A. Error: Expression syntaxB. Error: Lvalue required
C. Error: Rvalue requiredD. The Code runs successfully

3. 

Which of the following statements are correct about the program?

#include<stdio.h>
int main()
{
    int x = 30, y = 40;
    if(x == y)
        printf("x is equal to y\n");

    else if(x > y)
        printf("x is greater than y\n");

    else if(x < y)
        printf("x is less than y\n")
    return 0;
}

A. Error: Statement missingB. Error: Expression syntax
C. Error: Lvalue requiredD. Error: Rvalue required

4. 

Which of the following statements are correct about an if-else statements in a C-program?
1: Every if-else statement can be replaced by an equivalent statements using   ?: operators
2: Nested if-else statements are allowed.
3: Multiple statements in an if block are allowed.
4: Multiple statements in an else block are allowed.

A. 1 and 2B. 2 and 3
C. 1, 2 and 4D. 2, 3, 4

5. 

Which of the following statements are correct about the below program?

#include<stdio.h>
int main()
{
    int i = 0;
    i++;
    if(i <= 5)
    {
        printf("IndiaBIX\n");
        exit(0);
        main();
    }
    return 0;
}

A. The program prints 'IndiaBIX' 5 times
B. The program prints 'IndiaBIX' one time
C. The call to main() after exit() doesn't materialize.
D. The compiler reports an error since main() cannot call itself.




© 2008-2013 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Contact us: info@indiabix.com     Follow us on twitter!