Results 1 to 10 of 10

Thread: Expert Programers where are you..?

  1. #1
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 05:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Default Expert Programers where are you..?

    I need this output with function call in main program..
    remember that I need source code in c programing v 3.0 not c++

    • Output

    Enterstart number = 3
    Enter ending number = 8

    Results
    Number Square status factorial prime/not prime
    ------- ------- ------- -------- ---------------
    3 9 odd 6 Prime
    4 16 even 24 Not Prime
    5 25 odd 120 Prime
    6 36 even 720 Not Prime
    7 49 odd 5040 Prime
    8 64 even 40320 Not Prime

  2. #2
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 05:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Default

    also /t between 3 9 odd 6 and prime

  3. #3
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 05:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Default

    please help me I need this output urgent..................................

  4. #4
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 05:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Default

    ssssssssssshhhhh koeee haiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii????????????????? ????

  5. #5
    suraj goyal's Avatar
    suraj goyal is offline Senior Member
    Last Online
    14th March 2019 @ 02:28 PM
    Join Date
    05 Jul 2010
    Location
    suncity(jodhpur)
    Age
    34
    Gender
    Male
    Posts
    1,950
    Threads
    43
    Credits
    69
    Thanked
    89

    Default

    ok i will try to help u, plz w8 untill morning

  6. #6
    suraj goyal's Avatar
    suraj goyal is offline Senior Member
    Last Online
    14th March 2019 @ 02:28 PM
    Join Date
    05 Jul 2010
    Location
    suncity(jodhpur)
    Age
    34
    Gender
    Male
    Posts
    1,950
    Threads
    43
    Credits
    69
    Thanked
    89

    Default

    function ke through bana jruri hai ya main function main chalega?

  7. #7
    suraj goyal's Avatar
    suraj goyal is offline Senior Member
    Last Online
    14th March 2019 @ 02:28 PM
    Join Date
    05 Jul 2010
    Location
    suncity(jodhpur)
    Age
    34
    Gender
    Male
    Posts
    1,950
    Threads
    43
    Credits
    69
    Thanked
    89

    Default

    /*program created by suraj goyal to help ithoun */
    #include<stdio.h>
    #include<conio.h>
    funct(int , int);
    void main()
    {
    int num1, num2;
    clrscr();
    printf("enter first number\n");
    scanf("%d",&num1);
    printf("enter second number\n");
    scanf("%d",&num2);
    funct(num1,num2);
    }
    funct(int num1,int num2)
    {
    int sqr,temp;
    int mod,div=2,prime;
    float fact=1;
    char status;
    while(num1<=num2)
    {
    sqr=num1*num1;
    mod=num1%2;
    if (mod==0)
    status='e';//here "e" stands for even//
    else
    status='o';//here "o" stands for odd//
    temp=num1;
    while(temp>1)
    {
    fact=fact*temp;
    --temp;
    }
    for(div=2;div<num1;div++)
    {
    mod=num1%div;
    if (mod==0)
    break;
    }
    printf("number=%d,\tsquare=%d",num1,sqr);
    if(status=='e')
    printf("\teven,");
    else
    printf("\todd,");
    printf("\tfactorial=%.0f",fact);
    if(mod==0)
    printf("\tnot prime\n");
    else
    printf("\tprime\n");
    num1++;
    fact=1;
    }
    getch();
    return(0);
    }

    [CENTER][COLOR="Blue"][SIZE="5"]Respect seniors & follow the ITD rules[/SIZE][/COLOR][/CENTER][CENTER][COLOR="Red"][SIZE="5"]Peace and friendship...[/SIZE][/COLOR][/CENTER][CENTER][COLOR="blue"][SIZE="5"][URL="http://www.itdunya.com/showthread.php?p=2578950#post2578950"]disable right click on desktop[/URL] [/SIZE][/COLOR][/CENTER]

  8. #8
    suraj goyal's Avatar
    suraj goyal is offline Senior Member
    Last Online
    14th March 2019 @ 02:28 PM
    Join Date
    05 Jul 2010
    Location
    suncity(jodhpur)
    Age
    34
    Gender
    Male
    Posts
    1,950
    Threads
    43
    Credits
    69
    Thanked
    89

    Default

    the output will be:-


    enter first number
    3
    enter second number
    8
    number=3, square=9 odd, factorial=6 prime
    number=4, square=16 even, factorial=24 not prime
    number=5, square=25 odd, factorial=120 prime
    number=6, square=36 even, factorial=720 not prime
    number=7, square=49 odd, factorial=5040 prime
    number=8, square=64 even, factorial=40320 not prime


  9. #9
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 05:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Default

    Quote suraj goyal said: View Post
    /*program created by suraj goyal to help ithoun */
    #include<stdio.h>
    #include<conio.h>
    funct(int , int);
    void main()
    {
    int num1, num2;
    clrscr();
    printf("enter first number\n");
    scanf("%d",&num1);
    printf("enter second number\n");
    scanf("%d",&num2);
    funct(num1,num2);
    }
    funct(int num1,int num2)
    {
    int sqr,temp;
    int mod,div=2,prime;
    float fact=1;
    char status;
    while(num1<=num2)
    {
    sqr=num1*num1;
    mod=num1%2;
    if (mod==0)
    status='e';//here "e" stands for even//
    else
    status='o';//here "o" stands for odd//
    temp=num1;
    while(temp>1)
    {
    fact=fact*temp;
    --temp;
    }
    for(div=2;div<num1;div++)
    {
    mod=num1%div;
    if (mod==0)
    break;
    }
    printf("number=%d,\tsquare=%d",num1,sqr);
    if(status=='e')
    printf("\teven,");
    else
    printf("\todd,");
    printf("\tfactorial=%.0f",fact);
    if(mod==0)
    printf("\tnot prime\n");
    else
    printf("\tprime\n");
    num1++;
    fact=1;
    }
    getch();
    return(0);
    }


    thanks aloooooooot...........

  10. #10
    IT.BOY's Avatar
    IT.BOY is offline Senior Member
    Last Online
    17th November 2017 @ 12:13 PM
    Join Date
    26 Dec 2007
    Location
    *MAA KI AGOOSH*
    Gender
    Male
    Posts
    28,374
    Threads
    651
    Credits
    998
    Thanked
    3079

    Default

    [FONT="Jameel Noori Nastaleeq"][CENTER][COLOR="Blue"][SIZE="5"][B]Coming Soon...:)[/B][/SIZE][/COLOR][/CENTER][/FONT]

Similar Threads

  1. Programers
    By Hilals in forum Introduction
    Replies: 6
    Last Post: 30th January 2014, 06:51 AM
  2. Replies: 19
    Last Post: 26th July 2009, 11:28 AM
  3. C++ Programers please help..!
    By Fahad_997 in forum Ask an Expert
    Replies: 3
    Last Post: 9th March 2009, 02:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •