Search:

Type: Posts; User: Zach786

Search: Search took 0.00 seconds.

  1. works! thank you

    works! thank you
  2. Basic C programs get an error ( problem cause the program to stop working correctly)

    I have very basic program consist of two source files. Main.c contains the main function. Pint.c multiplies i by 2 and prints it. for whatever reason the program error out after the enter interger...
  3. [QUOTE=AndiPersti;1165792] while...

    [QUOTE=AndiPersti;1165792]

    while ((c=getchar()) !=EOF);
    So I have removed the semicolon. I can't remove the semicolon from else statement as laserlight suggested. I am getting compiler error....
  4. Tried that but still it doesn't seem to work...

    Tried that but still it doesn't seem to work correctly. Here the new code
    #include <stdio.h>

    int main (void)


    {
    int c=0;

    int num_words=0, num_chars=0, num_newlines=0;
  5. inner switch statement doesn't get executed if...

    inner switch statement doesn't get executed if you don't input 3. but it get works if the 3 is inputted.

    void main (){
    int zero=0;
    int one=0;
    int two=0;
    int three=0;
    int four=0;
    int...
  6. here is my new code. It still doesn't count...

    here is my new code. It still doesn't count character/words/new line correctly

    #include <stdio.h>

    int main (void)


    {
    int c=0;
  7. Second, please explain what you think is...

    Second, please explain what you think is happening in the following line:
    Basically it's a while loop reading keys from the keyboard by using function getchar(). The reading of characters from...
  8. added the break statement but there is no output...

    added the break statement but there is no output generate from inner switch statement
    12769
  9. I tried that. it still doesn't work. 12768 here...

    I tried that. it still doesn't work.
    12768
    here is my new code
    #include <stdio.h>

    int main (void)


    {
    char c=0;
  10. I am extend the program so number 3 is shown in...

    I am extend the program so number 3 is shown in words. E.g. Number three appears two times. Anything above 3 will print " the numbers appears more than two times. In order to accomplish this, I have...
  11. Need help with C program that count words, lines and characters

    My C program doesn't seem to be working correctly, output is completely off . Basically the program is suppose to output amount of characters, amount of word and amount of newlines that have been...
  12. Replies
    4
    Views
    1,508

    Thank you! Laserlight:)

    Thank you! Laserlight:)
  13. Replies
    4
    Views
    1,508

    So I moved the int Powervalue; before int X;. I...

    So I moved the int Powervalue; before int X;. I am getting new warnings i.e. C4700: Uninitialzied local variable 'PowerValue' Used and also get same error for 'NumbertoMultiply'
  14. Replies
    4
    Views
    1,508

    C2065 Undeclared Identifier Error

    I can't seem to figure out why I am get the error 2065: Undeclared identifier for 'PowerValue' and C2143:Syntax Error : Missing ';' before 'type' on line 13.


    #include <stdio.h>
    #include...
  15. Arithmetic Right shift will preserve whether an...

    Arithmetic Right shift will preserve whether an integer is negative or positive. In a logical right shift, it will lose the sign indicator i.e. make negative number into a positive number. So I wrote...
  16. Logical Shift: Shifting left by n bits on signed...

    Logical Shift: Shifting left by n bits on signed or unsigned binary number has effect of multiplying it by 2^n and Shifting right by n bits on an unsigned binary number has the effect of dividing by...
  17. could you pls explain this logic (((-1)>>1)

    could you pls explain this logic (((-1)>>1)<0) ? what does -1 represent?
  18. How to determine whether a logical or arithmetic shift is performed.

    If input value was shifted to the right on bit level. How can I determine whether a logical or arithmetic shift is performed.




    #include <stdio.h>
    #include <stdlib.h>


    void main ()
  19. # include void main (){ int zero=0; int...

    # include void main (){ int zero=0; int one=0; int two=0; int three=0; int four=0; int other_char=0; int x; while ((x=getchar()) !=26 && x!=EOF) { switch(x) { case'0': zero++;...
  20. I also initialized other_char=0 but it doesn't...

    I also initialized other_char=0 but it doesn't seem to count other characters correctly.
  21. It's working expect it doesn't' seem to count the...

    It's working expect it doesn't' seem to count the character correctly.

    12736

    Isn't this initialization the variables?

    int zero,one, two, three, four=0;

    I have changed it though
  22. C-program to count how many times each of the numbers have been typed

    I wrote a C-program to count how many times each of the numbers 0-4 have been typed. I am suppose to use (EOF) function as part of this assignment.


    void main (){
    int zero,one, two, three,...
  23. Efficiently multiplies a number by a factor 2

    I am relatively new to programming. I need help writing this program.

    Write a C-program that efficiently multiplies a number by a factor 2 to the power n. The number to multiply and n are...
Results 1 to 23 of 24