<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Part II C program im stuck in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856771#M94907</link>
    <description>what compiler are you using? im using bloodshed, and so far im not too happy with it.</description>
    <pubDate>Thu, 05 Dec 2002 05:26:23 GMT</pubDate>
    <dc:creator>Mikel Howel_1</dc:creator>
    <dc:date>2002-12-05T05:26:23Z</dc:date>
    <item>
      <title>Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856748#M94884</link>
      <description>ive been working on this and im tryint to pull info from the structure. but its not working i need to add this for each students final grade. the 3 quizes are worth 30% of the grade and the 2 test are worth 70%&lt;BR /&gt;something like this&lt;BR /&gt;&lt;BR /&gt; =(quizavg * 0.30)+(testsavg * 0.70)&lt;BR /&gt;if(c&amp;gt;=90) &lt;BR /&gt; &lt;BR /&gt;then give it a final grade from the weighted grade. anyhelp with this?&lt;BR /&gt;&lt;BR /&gt;       printf("You get an A\n"); &lt;BR /&gt;        else if((c&amp;gt;=80)&amp;amp;&amp;amp;(c&amp;lt;89)) &lt;BR /&gt;        printf("You get a B\n"); &lt;BR /&gt;        else if((c&amp;gt;=70)&amp;amp;&amp;amp;(c&amp;lt;79)) &lt;BR /&gt;        printf("You get a C\n"); &lt;BR /&gt;        else if((c&amp;gt;=60)&amp;amp;&amp;amp;(c&amp;lt;69)) &lt;BR /&gt;        printf("You get a D\n"); &lt;BR /&gt;        else &lt;BR /&gt;        printf("Failed the class\n"); &lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;struct student_info{&lt;BR /&gt;    char    fname[26];&lt;BR /&gt;    char    lname[31];&lt;BR /&gt;    int     quiza[4];&lt;BR /&gt;    int     quizb[4]; &lt;BR /&gt;    int     quizc[4];&lt;BR /&gt;    int     testa[4];&lt;BR /&gt;    int     testb[4];            &lt;BR /&gt;      &lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;typedef struct student_info SI;&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;    SI student[5];&lt;BR /&gt;    int iJunk;&lt;BR /&gt;    int iCount;&lt;BR /&gt;    int quiztot;&lt;BR /&gt;    int quizavg;&lt;BR /&gt;    int testtot;&lt;BR /&gt;    int testavg;&lt;BR /&gt;    &lt;BR /&gt;    for (iCount = 0; iCount &amp;lt; 3; iCount++){&lt;BR /&gt;        printf("Students First Name:");&lt;BR /&gt;        scanf("%s", student[iCount].fname );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        &lt;BR /&gt;        printf("Students Last Name:");&lt;BR /&gt;        scanf("%s", student[iCount].lname );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        printf("Score for Quiz 1:");&lt;BR /&gt;        scanf("%d", &amp;amp;student[iCount].quiza );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        printf("Score for Quiz 2:");&lt;BR /&gt;        scanf("%d", &amp;amp;student[iCount].quizb );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        printf("Score For Quiz 3:");&lt;BR /&gt;        scanf("%d", &amp;amp;student[iCount].quizc );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        printf("Score For Test 1:");&lt;BR /&gt;        scanf("%d", &amp;amp;student[iCount].testa );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        printf("Score For Test 2:");&lt;BR /&gt;        scanf("%d", &amp;amp;student[iCount].testb );&lt;BR /&gt;        iJunk = getchar();&lt;BR /&gt;        &lt;BR /&gt;        quiztot = SI.quiza + SI.quizb + SI.quizc;&lt;BR /&gt;        quizavg = quiztot/3;&lt;BR /&gt;        &lt;BR /&gt;        testtot = SI.testa + SI.testb;&lt;BR /&gt;        testavg = testtot/2;&lt;BR /&gt;        &lt;BR /&gt;        }&lt;BR /&gt;    printf("\n");&lt;BR /&gt;    &lt;BR /&gt;    printf("Press a key to continue...\n");&lt;BR /&gt;    iJunk = getchar();&lt;BR /&gt;    &lt;BR /&gt;    return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 03 Dec 2002 20:05:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856748#M94884</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-03T20:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856749#M94885</link>
      <description>anyone?</description>
      <pubDate>Tue, 03 Dec 2002 22:47:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856749#M94885</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-03T22:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856750#M94886</link>
      <description>I'll give it a shot since no one else has anything to say.&lt;BR /&gt;&lt;BR /&gt;Seems to me you have defined a datastructure type called SI then made an instance of it called student[].  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You then went through a routine which filled student[] with info from keyboard input.  I assume this part works OK.&lt;BR /&gt;&lt;BR /&gt;Now you say &lt;BR /&gt;"quiztot = SI.quiza + SI.quizb + SI.quizc; &lt;BR /&gt;quizavg = quiztot/3; "&lt;BR /&gt;&lt;BR /&gt;But SI is now the type and not the student[] so it is not clear to me what SI.testa refers to.  I would think you would need to say:&lt;BR /&gt;&lt;BR /&gt;quiztot = student[iCount].quiza + student[iCount].quizb + student[iCount].quizc&lt;BR /&gt;&lt;BR /&gt;Ron&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Dec 2002 23:49:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856750#M94886</guid>
      <dc:creator>Ron Kinner</dc:creator>
      <dc:date>2002-12-03T23:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856751#M94887</link>
      <description>Hi try this one with a structure. You have give First and Second name together and in the end it prints the summary also.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;struct data {&lt;BR /&gt;        char fname[26];&lt;BR /&gt;        char lname[31];&lt;BR /&gt;        int quiza, quizb, quizc, testa, testb, grade;&lt;BR /&gt;};&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;struct data student[3];&lt;BR /&gt;int i, q_total, t_total, q_avg, t_avg;&lt;BR /&gt;for (i=0; i&amp;lt;3; i++){&lt;BR /&gt;        printf("Enter the record No. %d\n", (i+1));&lt;BR /&gt;        printf("Enter the Students first Name &amp;amp; Second Name: ");&lt;BR /&gt;        scanf("%s %s", &amp;amp;student[i].fname, &amp;amp;student[i].lname);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Quiz A: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].quiza);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Quiz B: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].quizb);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Quiz C: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].quizc);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Test 1: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].testa);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Test 2: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].testb);&lt;BR /&gt;        q_avg = ((student[i].quiza)+(student[i].quizb)+(student[i].quizc))/3;&lt;BR /&gt;        t_avg = ((student[i].testa)+(student[i].testb))/2;&lt;BR /&gt;        student[i].grade = (q_avg*0.3)+(t_avg*0.7);&lt;BR /&gt;if((student[i].grade)&amp;gt;80)&lt;BR /&gt;        printf("You have Got Grade A\n");&lt;BR /&gt;if((student[i].grade)&amp;gt;60 &amp;amp;&amp;amp; (student[i].grade)&amp;lt;80)&lt;BR /&gt;        printf("You have Got Grade B\n");&lt;BR /&gt;if((student[i].grade)&amp;gt;40 &amp;amp;&amp;amp; (student[i].grade)&amp;lt;60)&lt;BR /&gt;        printf("You have Got Grade C\n");&lt;BR /&gt;if((student[i].grade)&amp;lt;40)&lt;BR /&gt;        printf("You Have failed\n");&lt;BR /&gt;        printf("Average=%d\n", (student[i].grade));&lt;BR /&gt;&lt;BR /&gt;        }&lt;BR /&gt;puts("");&lt;BR /&gt;printf("________________________________________________\n");&lt;BR /&gt;for (i=0; i&amp;lt;3; i++)&lt;BR /&gt;        printf("Entry No: %d, \n\t\t Name: %s %s\n\t\t Grade:%d\n", (i+1), student[i].fname, student[i].lname, student[i].grade);&lt;BR /&gt;printf("________________________________________________\n");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if u need more help.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 03 Dec 2002 23:52:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856751#M94887</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-03T23:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856752#M94888</link>
      <description>on the printf function on the bottom with the lines, what do they do?&lt;BR /&gt;&lt;BR /&gt;also if i wanted to get a average grade of everyone i entered how do i do that?</description>
      <pubDate>Wed, 04 Dec 2002 00:17:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856752#M94888</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-04T00:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856753#M94889</link>
      <description>The last printf function prints each students name and then their final score which is (q_avg*0.3)+(t_avg*0.7).&lt;BR /&gt;Just compile and try running it you'll know what is does. &lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Wed, 04 Dec 2002 00:24:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856753#M94889</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-04T00:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856754#M94890</link>
      <description>what does the \t mean?&lt;BR /&gt;&lt;BR /&gt;%s %s\n\t\t</description>
      <pubDate>Wed, 04 Dec 2002 02:20:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856754#M94890</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-04T02:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856755#M94891</link>
      <description>Hi Mikel,&lt;BR /&gt;Thats for a "TAB" singe \t is single TAB. This is used to have a formatted output on the screen.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev</description>
      <pubDate>Wed, 04 Dec 2002 02:42:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856755#M94891</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-04T02:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856756#M94892</link>
      <description>How do i get a average for all the students averages together to give the class a grade</description>
      <pubDate>Wed, 04 Dec 2002 05:24:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856756#M94892</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-04T05:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856757#M94893</link>
      <description>Hi,&lt;BR /&gt;The structure element grade has all data for the class so make a loop and add all the elements and divide by number of students which you have defined as 3.&lt;BR /&gt;for(i=0;i&amp;lt;3;i++)&lt;BR /&gt;sum+=(student[i].grade);&lt;BR /&gt;av_class_grade=(sum)/3;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev</description>
      <pubDate>Wed, 04 Dec 2002 08:05:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856757#M94893</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-04T08:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856758#M94894</link>
      <description>could i just plug that code in and it would work? where would be the best place to put it?</description>
      <pubDate>Wed, 04 Dec 2002 14:19:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856758#M94894</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-04T14:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856759#M94895</link>
      <description>is this how i would get the average for the class? i tried it and it didnt work, i declared the variable. help?&lt;BR /&gt;&lt;BR /&gt;for(iCount=0;iCount&amp;lt;3;iCount++) &lt;BR /&gt;sum+=(student[iCount].grade); &lt;BR /&gt;av_class_grade=(sum)/3; &lt;BR /&gt;&lt;BR /&gt;    if((av_class_grade)&amp;gt;90)//Gives letter grade&lt;BR /&gt;        printf("They have a A\n", student[iCount].fname, student[iCount].lname); &lt;BR /&gt;&lt;BR /&gt;    else if((av_class_grade=(sum))&amp;gt;80 &amp;amp;&amp;amp; (av_class_grade=(sum))&amp;lt;= 90) &lt;BR /&gt;        printf("They have a B\n"); &lt;BR /&gt;&lt;BR /&gt;    else if((av_class_grade=(sum))&amp;gt;70 &amp;amp;&amp;amp; (av_class_grade=(sum))&amp;lt;= 80) &lt;BR /&gt;        printf("They have a C\n"); &lt;BR /&gt;&lt;BR /&gt;    else if((av_class_grade=(sum))&amp;gt;60 &amp;amp;&amp;amp; (av_class_grade=(sum))&amp;lt;= 70)&lt;BR /&gt;        printf("They have a D\n"); &lt;BR /&gt;&lt;BR /&gt;    else if((av_class_grade=(sum))&amp;lt;60) &lt;BR /&gt;        printf("They failed the class\n");&lt;BR /&gt; }</description>
      <pubDate>Thu, 05 Dec 2002 01:16:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856759#M94895</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-05T01:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856760#M94896</link>
      <description>also i think i did the grades wrong because if they get a 89 79 69 they fail,i tried to make it equal or greater than but it still didnt work.</description>
      <pubDate>Thu, 05 Dec 2002 01:17:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856760#M94896</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-05T01:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856761#M94897</link>
      <description>As per the code i gave before you need to define &lt;BR /&gt;int sum, av_class_grade;&lt;BR /&gt;after #include&lt;BR /&gt;and then just at the end add the following code &lt;BR /&gt;sum=0;&lt;BR /&gt;for(i=0;i&amp;lt;3;i++)&lt;BR /&gt;sum+=(student[i].grade);&lt;BR /&gt;av_class_grade=(sum)/3;&lt;BR /&gt;printf("%d   %d\n", av_class_grade, sum);&lt;BR /&gt;if(av_class_grade&amp;gt;80)&lt;BR /&gt;        printf("The Class has Got Grade A\n");&lt;BR /&gt;if(av_class_grade&amp;gt;60 &amp;amp;&amp;amp; av_class_grade&amp;lt;80)&lt;BR /&gt;        printf("The Class has Got Grade B\n");&lt;BR /&gt;if(av_class_grade&amp;gt;40 &amp;amp;&amp;amp; av_class_grade&amp;lt;60)&lt;BR /&gt;        printf("The Class has Got Grade C\n");&lt;BR /&gt;if(av_class_grade&amp;lt;40)&lt;BR /&gt;        printf("The Class has failed\n");&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;it should work.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev</description>
      <pubDate>Thu, 05 Dec 2002 01:49:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856761#M94897</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-05T01:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856762#M94898</link>
      <description>im implementing that into theprogram right now, so i just put it after the student grades correct? and if i wanted it to only print the class average at the end of the program it could do that right? also, Im also thinking that if i made the program so you could enter x amount of people. and have a question asking if you want to continue y/n. then if you said n, it would print of all the class results, but if you push yes you could keep entering students.&lt;BR /&gt;&lt;BR /&gt;could i just make a variable for the students so ican add more than 3?</description>
      <pubDate>Thu, 05 Dec 2002 02:28:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856762#M94898</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-05T02:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856763#M94899</link>
      <description>Yes you could ask more students than 3 by asking for argument in the program. Change the main program to look something like this.&lt;BR /&gt;main(argc, argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;if (argc != 2){&lt;BR /&gt;printf("Usage: %s &lt;NO. of="" student=""&gt;\n", argv[0]);&lt;BR /&gt;exit(1);&lt;BR /&gt;}&lt;BR /&gt;Then continue with the normal codes...&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;Rajeev&lt;/NO.&gt;</description>
      <pubDate>Thu, 05 Dec 2002 02:40:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856763#M94899</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-05T02:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856764#M94900</link>
      <description>if i did that then it would let me enter x number of people right?&lt;BR /&gt;&lt;BR /&gt;im having problems with it printing to the final output. it gives some funky numbers.</description>
      <pubDate>Thu, 05 Dec 2002 02:48:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856764#M94900</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-05T02:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856765#M94901</link>
      <description>Yes it would let you x number of people but what you need to do is convert this character to intiger by atoi function. So the number of students will actually be .&lt;BR /&gt;no of student say x=atoi(argv[1]);&lt;BR /&gt;&lt;BR /&gt;and then u'll have to change the student count from 3 to the x variable where ever you are doing for(i=0;i&amp;lt;3...make x&lt;BR /&gt;&lt;BR /&gt;The program should be fine after that.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev</description>
      <pubDate>Thu, 05 Dec 2002 02:59:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856765#M94901</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-05T02:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856766#M94902</link>
      <description />
      <pubDate>Thu, 05 Dec 2002 04:15:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856766#M94902</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-05T04:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Part II C program im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856767#M94903</link>
      <description>Here is the full code.&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int sum, av_class_grade;&lt;BR /&gt;struct data {&lt;BR /&gt;        char fname[26];&lt;BR /&gt;        char lname[31];&lt;BR /&gt;        int quiza, quizb, quizc, testa, testb, grade;&lt;BR /&gt;};&lt;BR /&gt;main(argc, argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;struct data student[3];&lt;BR /&gt;int i, q_total, t_total, q_avg, t_avg;&lt;BR /&gt;int x;&lt;BR /&gt;if(argc != 2){&lt;BR /&gt;        printf("Usage: %s &lt;NO. of="" students=""&gt;\n", argv[0]);&lt;BR /&gt;        exit(1);&lt;BR /&gt;        }&lt;BR /&gt;x=atoi(argv[1]);&lt;BR /&gt;for (i=0; i&lt;X&gt;&lt;/X&gt;        printf("Enter the record No. %d\n", (i+1));&lt;BR /&gt;        printf("Enter the Students first Name &amp;amp; Second Name: ");&lt;BR /&gt;        scanf("%s %s", &amp;amp;student[i].fname, &amp;amp;student[i].lname);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Quiz A: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].quiza);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Quiz B: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].quizb);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Quiz C: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].quizc);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Test 1: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].testa);&lt;BR /&gt;        printf("Enter the Marks %s %s Got in Test 2: ", student[i].fname, student[i].lname);&lt;BR /&gt;        scanf("%d", &amp;amp;student[i].testb);&lt;BR /&gt;        q_avg = ((student[i].quiza)+(student[i].quizb)+(student[i].quizc))/3;&lt;BR /&gt;        t_avg = ((student[i].testa)+(student[i].testb))/2;&lt;BR /&gt;        student[i].grade = (q_avg*0.3)+(t_avg*0.7);&lt;BR /&gt;if((student[i].grade)&amp;gt;80)&lt;BR /&gt;        printf("You have Got Grade A\n");&lt;BR /&gt;if((student[i].grade)&amp;gt;60 &amp;amp;&amp;amp; (student[i].grade)&amp;lt;80)&lt;BR /&gt;        printf("You have Got Grade B\n");&lt;BR /&gt;if((student[i].grade)&amp;gt;40 &amp;amp;&amp;amp; (student[i].grade)&amp;lt;60)&lt;BR /&gt;        printf("You have Got Grade C\n");&lt;BR /&gt;if((student[i].grade)&amp;lt;40)&lt;BR /&gt;        printf("You Have failed\n");&lt;BR /&gt;        printf("Average=%d\n", (student[i].grade));&lt;BR /&gt;&lt;BR /&gt;        }&lt;BR /&gt;puts("");&lt;BR /&gt;printf("________________________________________________\n");&lt;BR /&gt;for (i=0; i&lt;X&gt;&lt;/X&gt;        printf("Entry No: %d, \n\t\t Name: %s %s\n\t\t Average Grade:%d\n", (i+1), student[i].fname, student[i].lname, student[i].grade);&lt;BR /&gt;printf("________________________________________________\n");&lt;BR /&gt;sum=0;&lt;BR /&gt;for(i=0;i&lt;X&gt;&lt;/X&gt;sum+=(student[i].grade);&lt;BR /&gt;av_class_grade=(sum)/3;&lt;BR /&gt;if(av_class_grade&amp;gt;80)&lt;BR /&gt;        printf("The Class has Got Grade A\n");&lt;BR /&gt;if(av_class_grade&amp;gt;60 &amp;amp;&amp;amp; av_class_grade&amp;lt;80)&lt;BR /&gt;        printf("The Class has Got Grade B\n");&lt;BR /&gt;if(av_class_grade&amp;gt;40 &amp;amp;&amp;amp; av_class_grade&amp;lt;60)&lt;BR /&gt;        printf("The Class has Got Grade C\n");&lt;BR /&gt;if(av_class_grade&amp;lt;40)&lt;BR /&gt;        printf("The Class has failed\n");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Just copy and run this with number of students as argument.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev&lt;/NO.&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 05 Dec 2002 04:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/part-ii-c-program-im-stuck/m-p/2856767#M94903</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-05T04:45:52Z</dc:date>
    </item>
  </channel>
</rss>

