online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include<stdio.h> int main(void) { int i, n; float x, sum=1, t=1; printf(" Enter the value for x : "); scanf("%f",&x); printf(" Enter the value for n : "); scanf("%d",&n); x=x*3.14159/180; /* Loop to calculate the value of Cosine */ for(i=1;i<=n;i++) { t=t*(-1)*x*x/(2*i*(2*i-1)); sum=sum+t; } printf(" The value of Cos(%f) is : %.4f", x, sum); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue