hi i cant get the output from the program given below

This is a discussion on hi i cant get the output from the program given below within the C Programming forums, part of the General Programming Boards category; Code: well this is the program #include <math.h> #define PI 3.1416 #define MAX 180 int main(void) { int angle; float ...

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    1

    hi i cant get the output from the program given below

    Code:
    well this is the program
    
    #include <math.h>
    #define PI 3.1416
    #define MAX  180
    int main(void)
    {
    	int angle;
    	float x,y;
    	
    	angle = 0;
    /*	printf("Angle  cos(angle)\n\n");*/
    	
    	while(angle <= MAX);
    	{
    	    x =(PI/MAX)*angle;
    	    y =cos(x);
    /*	printf("%15d %13.4f\n",angle, y);*/
    	angle = angle + 10;
    	}
    }
    
    please tel the solution for this

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Well your printf statements are inside comments, so they don't even get compiled. Did you know that?

    If that isn't your problem you need to be more specific and say what you're expecting and what you're getting.

  3. #3
    Maz
    Maz is offline
    Registered User Maz's Avatar
    Join Date
    Nov 2005
    Location
    Finland
    Posts
    194
    So this is what the homeworks are alike nowadays??

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calling an external program + capture output?
    By cyberfish in forum C++ Programming
    Replies: 4
    Last Post: 03-21-2008, 12:49 AM
  2. program looping with final output
    By hebali in forum C Programming
    Replies: 24
    Last Post: 02-28-2008, 09:58 AM
  3. Unusual program Output, Help
    By capvirgo in forum C Programming
    Replies: 8
    Last Post: 02-06-2008, 02:13 AM
  4. Redirecting program output straight to an edit control
    By bennyandthejets in forum C++ Programming
    Replies: 5
    Last Post: 07-05-2004, 08:25 AM
  5. Program Output
    By lavon in forum C Programming
    Replies: 1
    Last Post: 03-19-2002, 09:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21