<?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: C Program, im stuck in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855943#M94673</link>
    <description>Hi Try out this simple one where you pass the number of quize as argument and then supply the marks for each quiz and finally it prints the Grade and the average.&lt;BR /&gt;Let me know if you need more help in modifying it.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#define MAX 10&lt;BR /&gt;main(argc,argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;int i,j, buff[MAX], k, avr;&lt;BR /&gt;k=0;&lt;BR /&gt;if(argc != 2){&lt;BR /&gt;        printf("Usage: %s &lt;NO of="" quiz=""&gt;\n", argv[0]);&lt;BR /&gt;        exit(1);&lt;BR /&gt;        }&lt;BR /&gt;i = atof(argv[1]);&lt;BR /&gt;for(j=0;j&lt;I&gt;        printf("Enter the Marks for Quiz %d:", (j+1));&lt;BR /&gt;        scanf("%d", &amp;amp;buff[j]);&lt;BR /&gt;        }&lt;BR /&gt;for(j=0;j&lt;I&gt;        k=k+buff[j];&lt;BR /&gt;avr = k/i;&lt;BR /&gt;if(avr&amp;gt;80)&lt;BR /&gt;        printf("You have Got Grade A\n");&lt;BR /&gt;if((avr&amp;gt;60) &amp;amp;&amp;amp; (avr&amp;lt;80))&lt;BR /&gt;        printf("You have Got Grade B\n");&lt;BR /&gt;if((avr&amp;gt;40) &amp;amp;&amp;amp; (avr&amp;lt;60))&lt;BR /&gt;        printf("You have Got Grade C\n");&lt;BR /&gt;if(avr&amp;lt;40)&lt;BR /&gt;        printf("You Have failed\n");&lt;BR /&gt;        printf("Average=%d\n", avr);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev&lt;/I&gt;&lt;/I&gt;&lt;/NO&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Tue, 03 Dec 2002 05:10:25 GMT</pubDate>
    <dc:creator>Rajeev  Shukla</dc:creator>
    <dc:date>2002-12-03T05:10:25Z</dc:date>
    <item>
      <title>C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855938#M94668</link>
      <description>im doing a Grading program but i cant get the quiz scores to average, and the test to average as well. can anyone help me, its a C program&lt;BR /&gt; i think i can make a temp variable, but how?&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc,char*argv[])&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;int ch;&lt;BR /&gt;int c;&lt;BR /&gt;int iJunk;&lt;BR /&gt;&lt;BR /&gt;c = 0;&lt;BR /&gt;&lt;BR /&gt;ch = ' ';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Quiz 1:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Quiz 2:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Quiz 3:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Test 1:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Test 2:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if(c&amp;gt;=90)&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;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;return 0;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 03 Dec 2002 02:11:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855938#M94668</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T02:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855939#M94669</link>
      <description>&lt;BR /&gt;Where are you magically adding up scores, counting the number of "scores", and doing division?&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 03 Dec 2002 03:54:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855939#M94669</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-03T03:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855940#M94670</link>
      <description>Thats what im having trouble with, i dont know how to make it so it will add up the scores for the quiz, and the test sepertly. it only gives a grade for the last data entry. this is as far as i could go, but im stuck the rest of the way...</description>
      <pubDate>Tue, 03 Dec 2002 04:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855940#M94670</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T04:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855941#M94671</link>
      <description>&lt;BR /&gt;Use an array for the scores or &lt;BR /&gt;&lt;BR /&gt;declare another int&lt;BR /&gt;&lt;BR /&gt;int tot;&lt;BR /&gt;&lt;BR /&gt;then after each getc(stdin) line do this:&lt;BR /&gt;&lt;BR /&gt;tot += c;&lt;BR /&gt;&lt;BR /&gt;then before the IF tests do this:&lt;BR /&gt;&lt;BR /&gt;c = tot / 5;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 03 Dec 2002 04:34:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855941#M94671</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-03T04:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855942#M94672</link>
      <description>like this? i feel like a dummy asking all these questions. if this is not right could you copy and paste and insert? ive been working on this all day and im getting frustrated. thanks &lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc,char*argv[])&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;int ch;&lt;BR /&gt;int c;&lt;BR /&gt;int iJunk;&lt;BR /&gt;int tot;&lt;BR /&gt;&lt;BR /&gt;c = 0;&lt;BR /&gt;&lt;BR /&gt;ch = ' ';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Quiz 1:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;tot += c; &lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Quiz 2:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;tot += c; &lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Quiz 3:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;tot += c; &lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Test 1:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;tot += c; &lt;BR /&gt;&lt;BR /&gt;printf("\nEnter Grade For Test 2:\n");&lt;BR /&gt;scanf("%d",&amp;amp;c);&lt;BR /&gt;ch = getc(stdin);&lt;BR /&gt;tot += c; &lt;BR /&gt;&lt;BR /&gt;c = tot / 5;&lt;BR /&gt;if(c&amp;gt;=90)&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;ch = getc(stdin);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;return 0;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;} &lt;BR /&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 03 Dec 2002 04:55:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855942#M94672</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T04:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855943#M94673</link>
      <description>Hi Try out this simple one where you pass the number of quize as argument and then supply the marks for each quiz and finally it prints the Grade and the average.&lt;BR /&gt;Let me know if you need more help in modifying it.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#define MAX 10&lt;BR /&gt;main(argc,argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;int i,j, buff[MAX], k, avr;&lt;BR /&gt;k=0;&lt;BR /&gt;if(argc != 2){&lt;BR /&gt;        printf("Usage: %s &lt;NO of="" quiz=""&gt;\n", argv[0]);&lt;BR /&gt;        exit(1);&lt;BR /&gt;        }&lt;BR /&gt;i = atof(argv[1]);&lt;BR /&gt;for(j=0;j&lt;I&gt;        printf("Enter the Marks for Quiz %d:", (j+1));&lt;BR /&gt;        scanf("%d", &amp;amp;buff[j]);&lt;BR /&gt;        }&lt;BR /&gt;for(j=0;j&lt;I&gt;        k=k+buff[j];&lt;BR /&gt;avr = k/i;&lt;BR /&gt;if(avr&amp;gt;80)&lt;BR /&gt;        printf("You have Got Grade A\n");&lt;BR /&gt;if((avr&amp;gt;60) &amp;amp;&amp;amp; (avr&amp;lt;80))&lt;BR /&gt;        printf("You have Got Grade B\n");&lt;BR /&gt;if((avr&amp;gt;40) &amp;amp;&amp;amp; (avr&amp;lt;60))&lt;BR /&gt;        printf("You have Got Grade C\n");&lt;BR /&gt;if(avr&amp;lt;40)&lt;BR /&gt;        printf("You Have failed\n");&lt;BR /&gt;        printf("Average=%d\n", avr);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Rajeev&lt;/I&gt;&lt;/I&gt;&lt;/NO&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 03 Dec 2002 05:10:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855943#M94673</guid>
      <dc:creator>Rajeev  Shukla</dc:creator>
      <dc:date>2002-12-03T05:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855944#M94674</link>
      <description>I can see what your geting at, but when i run it, it says you have 33 errors.</description>
      <pubDate>Tue, 03 Dec 2002 06:24:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855944#M94674</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T06:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855945#M94675</link>
      <description>But that is what i want to do, enter number of quizes, and also do same for test. get a average for quiz, and average for test. then get a group average of everyone i entered. this is whatis throwing me for a loop</description>
      <pubDate>Tue, 03 Dec 2002 06:26:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855945#M94675</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T06:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855946#M94676</link>
      <description>hi,&lt;BR /&gt;the code posted by Rajeev works fine!&lt;BR /&gt;&lt;BR /&gt;Did you compile the program?&lt;BR /&gt;==============================&lt;BR /&gt;L1000: home/yogeeraj&amp;gt;cc test2.c&lt;BR /&gt;/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (test2.o) was detected. The linked output may not run on a PA 1.x system.&lt;BR /&gt;L1000: home/deg&amp;gt;a.out&lt;BR /&gt;Usage: a.out &lt;NO of="" quiz=""&gt;&lt;BR /&gt;L1000: home/yogeeraj&amp;gt;a.out 11&lt;BR /&gt;Enter the Marks for Quiz 1:12&lt;BR /&gt;Enter the Marks for Quiz 2:12&lt;BR /&gt;Enter the Marks for Quiz 3:34&lt;BR /&gt;Enter the Marks for Quiz 4:45&lt;BR /&gt;Enter the Marks for Quiz 5:67&lt;BR /&gt;Enter the Marks for Quiz 6:34&lt;BR /&gt;Enter the Marks for Quiz 7:67&lt;BR /&gt;Enter the Marks for Quiz 8:34&lt;BR /&gt;Enter the Marks for Quiz 9:67&lt;BR /&gt;Enter the Marks for Quiz 10:345&lt;BR /&gt;Enter the Marks for Quiz 11:345&lt;BR /&gt;You have Got Grade A&lt;BR /&gt;Average=193&lt;BR /&gt;L1000: home/yogeeraj&amp;gt;&lt;BR /&gt;==============================&lt;BR /&gt;&lt;BR /&gt;Why don't describe your problem with an example?&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj&lt;/NO&gt;</description>
      <pubDate>Tue, 03 Dec 2002 06:31:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855946#M94676</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-12-03T06:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855947#M94677</link>
      <description>hi,&lt;BR /&gt;the code posted by Rajeev works fine!&lt;BR /&gt;&lt;BR /&gt;Did you compile the program?&lt;BR /&gt;==============================&lt;BR /&gt;L1000: home/yogeeraj&amp;gt;cc test2.c&lt;BR /&gt;/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (test2.o) was detected. The linked output may not run on a PA 1.x system.&lt;BR /&gt;L1000: home/deg&amp;gt;a.out&lt;BR /&gt;Usage: a.out &lt;NO of="" quiz=""&gt;&lt;BR /&gt;L1000: home/yogeeraj&amp;gt;a.out 11&lt;BR /&gt;Enter the Marks for Quiz 1:12&lt;BR /&gt;Enter the Marks for Quiz 2:12&lt;BR /&gt;Enter the Marks for Quiz 3:34&lt;BR /&gt;Enter the Marks for Quiz 4:45&lt;BR /&gt;Enter the Marks for Quiz 5:67&lt;BR /&gt;Enter the Marks for Quiz 6:34&lt;BR /&gt;Enter the Marks for Quiz 7:67&lt;BR /&gt;Enter the Marks for Quiz 8:34&lt;BR /&gt;Enter the Marks for Quiz 9:67&lt;BR /&gt;Enter the Marks for Quiz 10:345&lt;BR /&gt;Enter the Marks for Quiz 11:345&lt;BR /&gt;You have Got Grade A&lt;BR /&gt;Average=193&lt;BR /&gt;L1000: home/yogeeraj&amp;gt;&lt;BR /&gt;==============================&lt;BR /&gt;&lt;BR /&gt;Why don't describe your problem with an example?&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj&lt;/NO&gt;</description>
      <pubDate>Tue, 03 Dec 2002 06:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855947#M94677</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-12-03T06:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855948#M94678</link>
      <description>when i compiled the program using bloodshed it came back with 33 errors. to me it looks right. but why does it come back with these errors?</description>
      <pubDate>Tue, 03 Dec 2002 06:44:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855948#M94678</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T06:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855949#M94679</link>
      <description>do you recomend a different c compiler? ill try the rest tomorrow because its late. thanks for the help. ill be on tomorrow probably asking more questions. thanks again</description>
      <pubDate>Tue, 03 Dec 2002 06:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855949#M94679</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T06:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855950#M94680</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;can you post the error messages you are getting?&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Tue, 03 Dec 2002 06:48:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855950#M94680</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-12-03T06:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855951#M94681</link>
      <description>this is what it came up with:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Executing  g++.exe...&lt;BR /&gt;g++.exe "C:\My Documents\Untitled3.cpp" -o "C:\My Documents\Untitled3.exe"   -g3  -I"C:\DEV-CPP\include"  -I"C:\DEV-CPP\include\g++-3"  -I"C:\DEV-CPP\include"   -L"C:\DEV-CPP\lib"&lt;BR /&gt;C:\My Documents\Untitled3.cpp:4: `argc' was not declared in this scope&lt;BR /&gt;C:\My Documents\Untitled3.cpp:4: `argv' was not declared in this scope&lt;BR /&gt;&lt;BR /&gt;C:\My Documents\Untitled3.cpp:5: ANSI C++ forbids declaration `main' with no type&lt;BR /&gt;C:\My Documents\Untitled3.cpp:5: initializer list being treated as compound expression&lt;BR /&gt;C:\My Documents\Untitled3.cpp:5: syntax error before `int'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:7: parse error before `{'&lt;BR /&gt;&lt;BR /&gt;C:\My Documents\Untitled3.cpp:9: ANSI C++ forbids declaration `k' with no type&lt;BR /&gt;&lt;BR /&gt;C:\My Documents\Untitled3.cpp:10: parse error before `if'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:12: ANSI C++ forbids declaration `exit' with no type&lt;BR /&gt;C:\My Documents\Untitled3.cpp:12: `int exit' redeclared as different kind of symbol&lt;BR /&gt;C:/DEV-CPP/include/stdlib.h:325: previous declaration of `void exit(int)'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:13: parse error before `}'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:14: ANSI C++ forbids declaration `i' with no type&lt;BR /&gt;C:\My Documents\Untitled3.cpp:14: warning: initialization to `int' from `double'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:15: parse error before `for'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:15: parse error before `;'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:15: syntax error before `++'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:17: `buff' was not declared in this scope&lt;BR /&gt;C:\My Documents\Untitled3.cpp:17: `j' was not declared in this scope&lt;BR /&gt;C:\My Documents\Untitled3.cpp:17: ANSI C++ forbids declaration `scanf' with no type&lt;BR /&gt;C:\My Documents\Untitled3.cpp:17: `int scanf' redeclared as different kind of symbol&lt;BR /&gt;C:/DEV-CPP/include/stdio.h:231: previous declaration of `int scanf(const char *, ...)'&lt;BR /&gt;&lt;BR /&gt;C:\My Documents\Untitled3.cpp:17: initializer list being treated as compound expression&lt;BR /&gt;C:\My Documents\Untitled3.cpp:18: parse error before `}'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:19: parse error before `;'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:19: syntax error before `++'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:21: ANSI C++ forbids declaration `avr' with no type&lt;BR /&gt;C:\My Documents\Untitled3.cpp:22: parse error before `if'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:30: ANSI C++ forbids declaration `printf' with no type&lt;BR /&gt;C:\My Documents\Untitled3.cpp:30: `int printf' redeclared as different kind of symbol&lt;BR /&gt;C:/DEV-CPP/include/stdio.h:211: previous declaration of `int printf(const char *, ...)'&lt;BR /&gt;C:\My Documents\Untitled3.cpp:30: initializer list being treated as compound expression&lt;BR /&gt;C:\My Documents\Untitled3.cpp:31: parse error before `}'&lt;BR /&gt;&lt;BR /&gt;C:\My Documents\Untitled3.cpp:6: storage size of `argv' isn't known&lt;BR /&gt;&lt;BR /&gt;Execution terminated</description>
      <pubDate>Tue, 03 Dec 2002 06:54:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855951#M94681</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T06:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855952#M94682</link>
      <description>My two words:&lt;BR /&gt;&lt;BR /&gt;First, you didn't initialize 'tot' to 0 at the beginning, so it can have any value at the beginning. So change&lt;BR /&gt;int tot;&lt;BR /&gt;to&lt;BR /&gt;int tot = 0;&lt;BR /&gt;&lt;BR /&gt;Second syntax of your main() in the second try is quite old and looks like your compiler do not accept it. So instead of:&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;&lt;BR /&gt;try:&lt;BR /&gt;&lt;BR /&gt;int main( int argc, char *argv[] )&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;&lt;BR /&gt;Adam&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Dec 2002 12:36:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855952#M94682</guid>
      <dc:creator>Adam J Markiewicz</dc:creator>
      <dc:date>2002-12-03T12:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855953#M94683</link>
      <description>i got it down to i bug, but when i run it it works, but only allows you to enter number of quiz then shuts off.&lt;BR /&gt;&lt;BR /&gt;here is the bug&lt;BR /&gt;&lt;BR /&gt;-I"C:\DEV-CPP\include"   -L"C:\DEV-CPP\lib"&lt;BR /&gt;C:\My Documents\Untitled2.cpp: In function `int main(int, char **)':&lt;BR /&gt;C:\My Documents\Untitled2.cpp:18: warning: assignment to `int' from `double'&lt;BR /&gt;&lt;BR /&gt;Execution terminated&lt;BR /&gt;Compilation successful&lt;BR /&gt;&lt;BR /&gt;can anyone help me with this?&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt; &lt;BR /&gt;#include &lt;STDLIB.H&gt; &lt;BR /&gt;#define MAX 10 &lt;BR /&gt;&lt;BR /&gt;int main(int argc,char*argv[])&lt;BR /&gt; &lt;BR /&gt;{ &lt;BR /&gt;int i,j, buff[MAX], k, avr; &lt;BR /&gt;int iJunk;&lt;BR /&gt;k=0; &lt;BR /&gt;if(argc != 2){ &lt;BR /&gt;printf("Usage: %s &lt;NO of="" quiz=""&gt;\n", argv[0]); &lt;BR /&gt;iJunk = getchar();&lt;BR /&gt;exit(1); &lt;BR /&gt;&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;i = atof(argv[1]); &lt;BR /&gt;for(j=0;j&lt;I&gt;printf("Enter the Marks for Quiz %d:", (j+1)); &lt;BR /&gt;scanf("%d", &amp;amp;buff[j]); &lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;for(j=0;j&lt;I&gt;k=k+buff[j]; &lt;BR /&gt;avr = k/i; &lt;BR /&gt;if(avr&amp;gt;80) &lt;BR /&gt;printf("You have Got Grade A\n"); &lt;BR /&gt;if((avr&amp;gt;60) &amp;amp;&amp;amp; (avr&amp;lt;80)) &lt;BR /&gt;printf("You have Got Grade B\n"); &lt;BR /&gt;if((avr&amp;gt;40) &amp;amp;&amp;amp; (avr&amp;lt;60)) &lt;BR /&gt;printf("You have Got Grade C\n"); &lt;BR /&gt;if(avr&amp;lt;40) &lt;BR /&gt;printf("You Have failed\n"); &lt;BR /&gt;printf("Average=%d\n", avr); &lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/NO&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 03 Dec 2002 16:21:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855953#M94683</guid>
      <dc:creator>Mikel Howel</dc:creator>
      <dc:date>2002-12-03T16:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855954#M94684</link>
      <description>&lt;BR /&gt;Mikel,&lt;BR /&gt;&lt;BR /&gt;on line 18 you are using atof() which is converting a string to a double-float, so assigning it to a "int" isn't cutting it.&lt;BR /&gt;&lt;BR /&gt;I think you want the "atoi" function.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Dec 2002 18:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855954#M94684</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-12-03T18:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855955#M94685</link>
      <description>sorry i forgot my log in so i had to do a new one, if this doesnt let me assign points then i will post a new message with this.  this is what i have so far. it works fine, except i dont know how to add 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;ch = getc(stdin); &lt;BR /&gt;&lt;BR /&gt;because i need the quizes to average out seperatly, and the same for the tests. and then add it to the program below, someone please help. me head hurts!!! lol&lt;BR /&gt;&lt;BR /&gt;&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;    &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;    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 19:30:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855955#M94685</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-03T19:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: C Program, im stuck</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855956#M94686</link>
      <description>ill do a new message since its not going to let me give point, so look for the new message thanks pals</description>
      <pubDate>Tue, 03 Dec 2002 19:31:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-program-im-stuck/m-p/2855956#M94686</guid>
      <dc:creator>Mikel Howel_1</dc:creator>
      <dc:date>2002-12-03T19:31:53Z</dc:date>
    </item>
  </channel>
</rss>

