# 52 Problems By tamim Shariar

 0 Hey, Hope you are doing well.I am absolutely a new programmer.I have been facing trouble for couple of days.I am exercising "52 programming problems and Solution" By tamim Shariar Subin. In program number 8,I am facing trouble to sort the number.I can sort numbers,but I am unable to get from users' input.Can anyone tell me how to do that ?Please give me the full code.I am really very disappointed Thanks Khan asked 28 Feb '16, 10:13 AhadKhan 95●3●23 1 আপনার কোড সহ প্রশ্ন করেন (28 Feb '16, 12:16) menon 1 প্রথমে কতটুকু চেষ্টা করেছ, সেটা জানতে হবে, তাই তোমার কোড শেয়ার কর। (28 Feb '16, 13:41) Tamim Shahriar Subeen ♦♦

 -1 ``````int main(){ int i,j,kase,t,sorted,temp; int ara[1000]; scanf("%d",&t); for(kase=1;kase<=t;kase++){ for(i=0;i<3;i++){ scanf("%d",&ara[i]); } while(1){ sorted=0; for(j=0;j<3;j++){ if(ara[j]>ara[j+1]){ temp=ara[j]; ara[j]=ara[j+1]; ara[j+1]=temp; sorted=1; } } if(sorted==0){ break; } } for(i=0;i<3;i++){ printf("%d",ara[i]); } } } `````` answered 28 Feb '16, 17:42 AhadKhan 95●3●23 __salman__ ♦♦ 1.1k●2●11 1 ভাই কোডটা একটু এডিট করে ইন্ডেন্ট করে দেন (28 Feb '16, 17:51) menon Paste korle kemon jeno hibijibi hoy ,taw abar ditesi (28 Feb '16, 18:38) AhadKhan কোড ফরম্যাটিং এত সহজ তাও এখানে এত ভুল কিভাবে হয়? (28 Feb '16, 18:40) __salman__ ♦♦
 -1 ``````#include #include #include #include #include int main(){ int i,j,kase,t,temp,sorted,l; int ara[100]; scanf("%d",&t); for(kase=1;kase<=t;kase++){ for(i=0;i<3;i++){ scanf("%d",&ara[i]); } printf("Case %d:",kase); while(1){ sorted=0; for(j=0;j<3;j++){ if(ara[j]>ara[j+1]){ temp=ara[j]; ara[j]=ara[j+1]; ara[j+1]=temp; sorted=1; } } if(sorted==0){ break; } } for(l=0;l<3;l++){ printf(" %d",ara[l]); } printf("\n"); } return 0; } `````` answered 28 Feb '16, 18:37 AhadKhan 95●3●23 __salman__ ♦♦ 1.1k●2●11 এটি মনে প্রশ্নের সাথে attach হবে। (29 Feb '16, 06:37) Kaiser Ahmed
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×402
×214
×54

question asked: 28 Feb '16, 10:13

question was seen: 3,763 times

last updated: 29 Feb '16, 06:37