i got up with this following code now. Could someone help me with displaying the output of this program because the last printf statement isnt getting displayed in the output screen.
Code:
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define pi 3.414
void main()
{
int freq,fs,amplitude,cycle;
double angle,increment,sample;
printf("enter the desired frequency of the signal:\n");
scanf("%d",&freq);
printf("enter the desired sampling frequency:\n");
scanf("%d",&fs);
printf("enter the amplitude of the signal:\n");
scanf("%d",&litude);
angle=0;
increment=(2*pi)/(fs/freq);
for (cycle=1;cycle<=freq;cycle++)
{
while (angle<=(2*pi))
{
sample=amplitude * sin(angle);
angle=angle+increment;
}
printf("%lf/t",&sample);/*here the output is not getting displayed*/
}
}