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 Java Programming
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 - Input / Output - Discussion

@ : Home > C Programming > Input / Output > General Questions - Discussion

Read more:

"I never think of the future. It comes soon enough."
- Albert Einstein
5. 

To print out a and b given below, which of the following printf() statement will you use?

#include<stdio.h>

float a=3.14;
double b=3.14;

[A]. printf("%f %lf", a, b);
[B]. printf("%Lf %f", a, b);
[C]. printf("%Lf %Lf", a, b);
[D]. printf("%f %Lf", a, b);

Answer: Option C

Explanation:

To print a float value, %f is used as format specifier.

To print a double value, %lf is used as format specifier.

Therefore, the answer is printf("%f %lf", a, b);


Yuvraj said: (Thu, Jul 22, 2010 02:02:39 PM)    
 
Please tell me the program code for the output as given below.

     *
* *
* * *
* * * *

Sankar said: (Fri, Oct 22, 2010 06:59:30 AM)    
 
Hi Yuvraj, try this code

int ix, iy;
for(ix = 1; ix <= 4; ix++)
{
for(iy = 0; iy < ix; iy++)
{
printf("*");
}
printf("\n");
}

Write your comments here:
Name *:     Email:


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

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