Thread: Header files

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    31

    Header files

    Modify program 3 by saving the header file on your memory stick and remove it from the Header section of the VC++ in the Solutions window.

    Code:
    
    
    Code:
    /* Programmer : Himanshu Parmar
        PRG155F
    	DATE : March 27th 2013
    	LAB 9 : Defines,Macros And Header files */
    #include<stdio.h>
    #define pi 3.141592654
    #define A (num) * (pi) * (Radius)  /* a macro defines a math equation */
    float spherevolume (float);
    main()
    {
    	float a,c;
    	printf("Please enter the radius: ");
    	scanf("%f",&a);
    	c = spherevolume(a);
    	 printf("\n\nThe volume is : %.3f",c);
        getch();
    }
    float spherevolume (float b)
    {
    	
    	float num,Radius,d;
    	num = 1.333333333;
    	Radius = b * b * b;
    	d = A;
    	return(d);
    	getch();
    	
    }
    Can you help me Please?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Attempt to do this assignment!
    Post your attempt.
    Put the code in three separate code blocks; one per file.
    Ask a question about your posted attempt.
    Post the Compiler/Linker errors or warnings.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    10
    I Think It Is A MATHEMATICAL Function!!
    So Put Hetter File As #include<math.h>
    And try it

  4. #4
    young grasshopper jwroblewski44's Avatar
    Join Date
    May 2012
    Location
    Where the sidewalk ends
    Posts
    294
    I Think It Is A MATHEMATICAL Function!!
    So Put Hetter File As #include<math.h>
    And try it
    Nope.

    See stahta01's post for a great place to start.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with Header Files and Source files
    By yukapuka in forum C Programming
    Replies: 3
    Last Post: 10-10-2012, 01:57 AM
  2. about #include files and header files
    By bulletbutter in forum C++ Programming
    Replies: 9
    Last Post: 04-18-2008, 10:24 AM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  4. Replies: 4
    Last Post: 12-14-2005, 02:21 PM
  5. include library header in header files
    By Raison in forum C++ Programming
    Replies: 6
    Last Post: 09-27-2004, 02:50 AM