Thread: hi i cant get the output from the program given below

  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
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    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
    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, 10:58 AM
  3. Unusual program Output, Help
    By capvirgo in forum C Programming
    Replies: 8
    Last Post: 02-06-2008, 03: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, 10:32 PM