You are not logged in.

#1 2015-09-15 04:08:16

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
Website

Program Output:

http://interviewquestionsanswers.org/quiz/C-Programming http://interviewquestionsanswers.org/qu … Structures

Directions:
What is the output of given program if user enter "xyz" ?

Question:
#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);
}

Option A):
Enter your age: xyz "after that program will stop"
Option B):
Enter your age: xyz You have lived for 0.00000 seconds
Option C):
Enter your age: xyz You have lived for 0 seconds
Option D):
Run time error

Correct Answer is Option B):
Enter your age: xyz You have lived for 0.00000 seconds


Failure is the first step towards seccess.

2015-09-15 04:08:16

Advertisement
Ads By Google

Re: Program Output:



Board footer