#include <stdio.h>

main()
{
   int a,b,c,d,n;
   float e,R_N;
   scanf("%f",&e);
   n=e*100;
   a=n%10;
   n=n/10;
   b=n%10;
   n=n/10;
   c=n%10;
   n=n/10;
   d=n%10;
   n=n/10;
   R_N=(a*1000+b*100+c*10+d)/100.0;
   printf("%0.2f",R_N);
   return 0;
}

ইনপুট ১২.৩৪ হলে আউটপুট ৪৩.২১ হয়। কিন্তু ৫৬.৭৮ হলে ৭৭.৬৫ কেন?

asked 18 Apr, 14:24

beginner%20level's gravatar image

beginner level
393

edited 18 Apr, 15:16

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
53118

1

আমি তো চালিয়ে দেখলাম সঠিক আউটপুটই দিচ্ছে।

(19 Apr, 12:10) Ashfaqur Rahman

প্রোগ্রামটি অন্য কোনো ভাবে করা যায় কী? গেলে কিভাবে?

(20 Apr, 02:39) beginner level

float input = 56.78;
int num = (int) input;                     // 56

input = input - num;                       // 0.78
input *= 100;                              // 78.0 
int num2 = (int) input;                    // 78

now, print num2 & num reversely
permanent link

answered 07 May, 03:16

alamarif's gravatar image

alamarif
111

edited 07 May, 11:04

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
53118

Your answer
toggle 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

Question tags:

×70
×38

question asked: 18 Apr, 14:24

question was seen: 277 times

last updated: 07 May, 11:04