User Profile

Collapse

Profile Sidebar

Collapse
ssharish
ssharish
Last Activity: Apr 24 '07, 10:32 AM
Joined: Oct 22 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ssharish
    replied to if-else statement
    in C
    this is the simple way of finding odd or even

    Code:
    if(num % 2 == 0)
        printf("Even\n");
    else
      printf("Odd\n");
    there are many different ways of finding odd and even. Depends upon the complexity of your program

    main should return value, Have a look at this main

    Code:
    int main()
    {
       ---
       ---
    ...
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to curious scanf problem
    in C
    well the alterntive for that can be soemthing like this

    Code:
    #include <stdio.h>
    #include <string.h>
    
    int main()
    {
        int ch;
        
        printf("Please enter [Y/N]\n?");
        ch = getchar();
        
        if('Y' == toupper(ch))
            printf("You eneter \"YES\"");
        else
            printf("You
    ...
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to need help!!!!!
    in C
    lol, where is your code. show us your attenpt. no one is going to do your assignment here. We can help you on how to solve your problem only if can show us your progress.

    ssharish
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to helloooooooooooooooooo
    in C
    Thats good, so do u have any questions

    ssharish
    See more | Go to post

    Leave a comment:


  • [QUOTE=unknownbo mb]Hey all i really hope you can help me out.

    Im compiling a project and im getting 2 errors which are saying local function definitions are illegal.
    Anyone know what this mean? And especially HOW to fix it??

    Thanks.. Sorry if this is a noob question.. I AM still a noobcoder.

    Greetz[/QUOTE

    it would be betterif u could post some code

    ssharish
    See more | Go to post

    Leave a comment:


  • Code:
    #include<stdio.h>
    
    int main()
    {
        int num;
        
        printf("Enter a decimal number\n?");
        scanf("%d",&num);
        
        printf("Hexadeciaml -> %X\n",num);
        getchar();
        getchar();
        return 0;
    }
    this is just a sample code.

    ssharish
    See more | Go to post

    Leave a comment:


  • There isn't any specific function for that, you will have write code for that. The best routine which i suggest for that is to use getchar and some loops.

    Dont use scanf to read a string.

    Have a go with this hints. post a message if u are stuck

    ssharish
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to To install C compiler
    in C
    If u havn't got one try Dev-c++ which is quite good, thats the one which i am using ans its easy to install as well. Which u dont find any difficulty at all!!!

    ssharish
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to nested loop
    in C
    So u mean after a user has entered a string or a char followed with the period which terminated the string. After that, u wanted again to to read a string. Is that right. If that was the case.

    Code:
    #include<stdio.h>
    
    void clear_buffer(void);
    
    int main()
    {
        char string[25];
        int choice=1;
        
        while(choice)
        {
            printf("Enter
    ...
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to nested loop
    in C
    It donst look to me like it is giving you some problem. It will work fine and it is working fine in my system.

    the only suggestion which i can give is avoid using scanf() function. for reading a char. instead use getchar()!!!

    ssharish
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to Reading data under Linux
    in C
    which distribution of linux are u using. the code looks to ok. and what compiler are u using

    ssharish
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to C- Programming for ARM Microcontrollers
    in C
    http://www.heyrick.co. uk/assembler/


    Google is the best friend

    ssharish
    See more | Go to post

    Leave a comment:


  • ssharish
    replied to Extra Digits of Precision
    in C
    Well there is member function with the cout object called a precision which actually set or gets the precision. The following shows u on how to use it

    Code:
    cout.precision(5); // Sets the precsion to 5
    some sample code using the precision

    Code:
    #include <iostream>
    #include <cstdlib>
    
    using namespace std;
    
    int _tmain(int argc, _TCHAR* argv[])
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...