User Profile

Collapse

Profile Sidebar

Collapse
gfanning23
gfanning23
Last Activity: Apr 4 '16, 05:26 PM
Joined: Mar 9 '16
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • gfanning23
    replied to no output in compiler.....why?
    in C
    my code.

    Code:
    #include <stdio.h>
    int main ()
    {
    /* variable definition: */
    char StudentName[100];
    float ExamValue, Sum, Avg, value;
    int students, exams, studentname;
     
    // Loop through Students
    while (students > 0)
    {
    // Initialize
    Sum = 0.0;
    students = 0;
    studentname =0;
    printf("Enter Student Name \n");
    scanf("%s", StudentName);
    ...
    See more | Go to post

    Leave a comment:


  • gfanning23
    replied to no output in compiler.....why?
    in C
    the Array of strings that is..
    See more | Go to post

    Leave a comment:


  • gfanning23
    replied to no output in compiler.....why?
    in C
    Do you have any examples? of what that would look like?
    See more | Go to post

    Leave a comment:


  • gfanning23
    started a topic no output in compiler.....why?
    in C

    no output in compiler.....why?

    I have been tasked with making this code allow the user to enter an unspecified amount of student names and avg here 3 test grades. Once that is done I set it to end the loop when a negative number is entered. (atleast that's the plan) When the code is put into the compiler (ideone.com) it runs successfully but there is not output....why?

    Code:
    #include <stdio.h>
    int main ()
    {
    /* variable definition: */
    ...
    See more | Go to post

  • gfanning23
    started a topic stopping a loop
    in C

    stopping a loop

    I have been struggling with this ever since my first post. I need to break this loop by way of too many integers entered.

    Code:
    #include <stdio.h>
    int main ()
    {
    /* variable definition: */
    int count, value, sum; double avg;
    /* Initialize */
    count = 0;
    sum = 0; avg = 0.0;
    // Loop through to input values
    while (count < 5)
    {
    printf("Enter a positive Integer\n");
    ...
    See more | Go to post

  • gfanning23
    started a topic entering specific amount of integers
    in C

    entering specific amount of integers

    I am trying to write the code so it only enters a specific amount of numbers to average using a sentinel value.

    [CODE]#include <stdio.h>
    int main ()
    {
    /* variable definition: */
    int count, value, sum; avg;
    /* Initialize */
    count = 0;
    sum = 0; avg = 0.0;
    // Loop through to input values
    while(1){
    printf("Enter the number of integers you want to add and find average...
    See more | Go to post
    Last edited by gfanning23; Mar 24 '16, 12:45 PM. Reason: updated code

  • gfanning23
    replied to calculate saletax price
    in C
    this is what I did.

    Code:
    #include <stdio.h>
    
    int main ()
    {
    /* variable definition: */
    float price, salestax, setprice;
    /* Prompt user for price */
    printf("Enter the price in dollars: \n");
    // Input the price
    scanf("$%f", &price);
    /* Prompt user for salestax */
    printf("Enter the state sales tax: \n");
    // Input the salestax
    ...
    See more | Go to post

    Leave a comment:


  • gfanning23
    replied to calculate saletax price
    in C
    Thanks,

    How would I write that line so it outputs the setprice?
    See more | Go to post

    Leave a comment:


  • gfanning23
    started a topic calculate saletax price
    in C

    calculate saletax price

    I need to be able to show the output of price in dollars, state tax and price with sales tax, so far I have the following. What am I doing wrong or what have I left out. The code runs but doesn't not show any output.

    the code:

    Code:
    int main ()
    {
    /* variable definition: */
    float price, salestax, setprice;
    /* Prompt user for price */
    printf("Enter the price in dollars: \n");
    ...
    See more | Go to post

  • Thanks so much DON! You and your explanation haves been a great help to me. This class I'm taking is a tough one and I'm sure it will bring me back to this site quite a bit this semester. I hope your around to clarify. Thanks!
    See more | Go to post

    Leave a comment:


  • here is the full code. I need to know why F = 3 after the code is ran. This is all new to me and some help is greatly appreciated. Thanks in advance.

    #include <stdio.h>
    int main(void) {
    int i,j;
    float f,g;
    i = 5; j = 2;
    f = 3.0;
    f = f + j / i;
    g = (f + j )/i;
    printf("value of f,g is %f,%f\n", f,g);
    return 0;
    }

    output : value of f,g is 3.00000, 1.00000...
    See more | Go to post

    Leave a comment:


  • basic C code question, what does this in code mean %f,%f\n

    what does this in code mean %f,%f\n
    See more | Go to post
No activity results to display
Show More
Working...