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 > Find Output of Program

Exercise

"Act well your part; there all honor lies."
- Alexander Pope
1. 

What will be the output of the program?

#include<stdio.h>
int main()
{
    int i=0;
    for(; i<=5; i++);
        printf("%d,", i);
    return 0;
}

A. 0, 1, 2, 3, 4, 5B. 5
C. 1, 2, 3, 4D. 6

2. 

What will be the output of the program?

#include<stdio.h>
int main()
{
    char str[]="C-program";
    int a = 5;
    printf(a >10?"Ps\n":"%s\n", str);
    return 0;
}

A. C-programB. Ps
C. ErrorD. None of above

3. 

What will be the output of the program?

#include<stdio.h>
int main()
{
    int a = 500, b = 100, c;
    if(!a >= 400)
        b = 300;
    c = 200;
    printf("b = %d c = %d\n", b, c);
    return 0;
}

A. b = 300 c = 200B. b = 100 c = garbage
C. b = 300 c = garbageD. b = 100 c = 200

4. 

What will be the output of the program?

#include<stdio.h>
int main()
{
    unsigned int i = 65535; /* Assume 2 byte integer*/
    while(i++ != 0)
        printf("%d",++i);
    printf("\n");
    return 0;
}

A. Infinite loop
B. 0 1 2 ... 65535
C. 0 1 2 ... 32767 - 32766 -32765 -1 0
D. No output

5. 

What will be the output of the program?

#include<stdio.h>
int main()
{
    int x = 3;
    float y = 3.0;
    if(x == y)
        printf("x and y are equal");
    else
        printf("x and y are not equal");
    return 0;
}

A. x and y are equalB. x and y are not equal
C. UnpredictableD. No output




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

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