Hello! Please Login or Register to ask your own question.

User Unicodist

Member for: 11 months (since Jul 3, 2017)
Type: Moderator
Extra privileges: Recategorizing any question
Editing any question
Editing any answer
Editing any comment
Editing posts silently
Closing any question
Selecting answer for any question
Viewing IPs of anonymous posts
Approving or rejecting posts
Hiding or showing any post
Deleting hidden posts
Full name: Ashish Neupane
Location: Birtamode 7, Jhapa
Website: unicodist.blogspot.com
About: Learning some programming and how to use logic as codes... :)

Activity by Unicodist

Score: -3,050 points (ranked #535)
Title:
Questions: 4 (2 with best answer chosen)
Answers: 28 (2 chosen as best)
Comments: 18
Voted on: 2 questions, 4 answers
Gave out: 6 up votes, 0 down votes
Received: 14 up votes, 1 down vote

Wall for Unicodist

Please log in or register to post on this wall.
Hey guys, my program to find the middle number between 3 numbers from user, it is not so compact and advance, but i hope it helps someone in their level of study, i have the code in C language as well as in the QBASIC language, please tell me if you like the logic and please tell me if you find any bug in it ,


C Program:

#include<stdio.h>
void main()
{
    int a, b, c, d;

    scanf("%d%d%d",&a,&b,&c);

    if (a>b&&a<c||a<b&&a>c)
    {
        printf("%d is the middle number.",a);
    }
    else if (b<a&&b>c||b>a&&b<c)
    {
        printf("%d is the middle number",b);
    }
    else
        printf("%d is the middle number.",c);
}


QBASIC syntax:

CLS
INPUT "Enter three numbers: "; a
INPUT "Enter annother number: "; b
INPUT "Enter another number: "; c
IF a < b AND a > c OR a > b AND a < c THEN
    PRINT a; "is the middle number.";
ELSEIF b > a AND b < c OR b < a AND b > c THEN
    PRINT b; "is the middle number."
ELSE
    PRINT c; "is the middle number."
END IF
END
 

Thank you :)
Sep 13, 2017 by Unicodist
Hey guys! check this code out, it will take input in any number system and can convert it to any number system, This is made by me, however, you can not use any number system that has base more than 10 because it doesn't support alphabets as numbers, but in next update, i will fix that too, please see this code and give me feedback what do you think about the code and please tell me if you find any bugs/errors. :)

#include<stdio.h>
#include<math.h>
void main()
{
    int inpt, outpt=0, inbase, outbase, i=0, ind=0, rem, mul=1;

    printf("Enter the input base: (Not more than 10)");
    scanf("%d",&inbase);
    printf("\nEnter the output base: (Not more than 10)");
    scanf("%d",&outbase);


    printf("\nEnter the number you want to convert: ");
    scanf("%d",&inpt);

    while (inpt)
    {
        rem=inpt%10;
        inpt/=10;
        ind+=(rem*pow(inbase,i));
        i++;
    }

    while (ind)
    {
        rem=ind%outbase;
        ind/=outbase;
        outpt=outpt+rem*mul;
        mul*=10;
    }
    printf("\nThe equivalent number is: %d\n",outpt);



}
Sep 11, 2017 by Unicodist
Thank you for visiting/stalking my wall. ????????
Sep 8, 2017 by Unicodist
wELCOME HERO
Jul 14, 2017 by coderpradip
**** Advertise with us ****
...