You are not logged in. Please login at www.codechef.com to post your questions!

×

formatted input with scanf..

include<stdio.h>

include<stdlib.h>

int main() { float balance,deduction; int withdrawl; scanf("%d %4.2f",&withdrawl,&balance); printf("%4.2f",balance); return 0; } input 30 120.00 output 0.000000 it seems as if scanf is not reading the value of balance in the specified format. why is it so?

asked 28 Aug '12, 22:12

zubin29's gravatar image

2★zubin29
1111
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×170
×40
×1

question asked: 28 Aug '12, 22:12

question was seen: 1,458 times

last updated: 20 May '17, 11:20