InidBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming Java Programming
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
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test
Group Disucssion HR Interview Questions Technical Interview Questions Body Language

Exercise

"If you judge people, you have no time to love them."
- Mother Teresa

C Programming - Const

@ : Home > C Programming > Const > Find Output of Program
1. 

What will be the output of the program?

#include<stdio.h>

int main()
{
    int y=128;
    const int x=y;
    printf("%d\n", x);
    return 0;
}

A.
128
B. Garbage value
C. ErrorD. 0

2. 

What will be the output of the program?

#include<stdio.h>

int main()
{
    const int i=0;
    printf("%d\n", i++);
    return 0;
}

A. 10B. 11
C. No outputD.
Error: ++needs a value

3. 

What will be the output of the program?

#include<stdio.h>

int main()
{
    const c = -11;
    const int d = 34;
    printf("%d, %d\n", c, d);
    return 0;
}

A. ErrorB.
-11, 34
C. 11, 34D. None of these

4. 

What will be the output of the program?

#include<stdio.h>

int main()
{
    const char *s = "";
    char str[] = "Hello";
    s = str;
    while(*s)
        printf("%c", *s++);

    return 0;
}

A. ErrorB. H
C.
Hello
D. Hel

5. 

What will be the output of the program?

#include<stdio.h>
int get();

int main()
{
    const int x = get();
    printf("%d", x);
    return 0;
}
int get()
{
    return 20;
}

A. Garbage valueB. Error
C.
20
D. 0



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