Join Regular Classroom : Visit ClassroomTech

Author name: Puja Paul

Coding Question 20

The equation x2+y2=r2 represent a circle which centres at origin and radius is r. Write a program that read r from the keyboard and print the number of points with integer co-ordinate that lie on the circumference of the circle.    #include<stdio.h> int main() { int x,y,r; printf("n Enter the radius:"); scanf("%d",&r); for(x=-r;x<=r;x++) { for(y=-r;y<=r;y++) […]

Coding Question 20 Read More »

Coding Question 19

Write a C program to count the frequency of each vowel from a user-supplied string. #include<stdio.h> #include<string.h> int main() { char s[20],i,v=0,c=0; printf("n Enter the string: "); gets(s); puts(s); for(i=0;s[i]!=”;i++) { if((s[i]>=65 && s[i]<=91)||(s[i]>=97 && s[i]<=122)) switch(s[i]) { case ‘a’: case ‘A’: case ‘e’: case ‘E’: case ‘i’: case ‘I’: case ‘o’: case ‘O’: case

Coding Question 19 Read More »

Coding Question 18

Write a program which take an integer as input and print the digits of an integer in words, after storing in a character array. [ if input : 2403 , output : Two Four Zero Three] #include<stdio.h> int main() { int num,b=0,r,temp; char *c[]={"Zero ","One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "}; printf("n

Coding Question 18 Read More »

Coding Question 17

Write a program to print the following series: #include<stdio.h> int fact(int i) { int fact=1,x; for(x=1;x<=i;x++) { fact=fact*x; } return fact; } int main() { int r,i,x; float sum=0.0; printf("n Enter the range: "); scanf("%d",&r); for(i=2;i<=r+1;i++) { x=fact(i); sum=sum + ((float)(i-1)/(float)x); } printf("n Result=%.4f",sum); return 0; } Join Our Telegram Group Visit our Facebook Page

Coding Question 17 Read More »

Coding Question 16

Write a program to print the  following (Number of lines should be given as input by the users): ** * ** * * * ** * * * * * * #include<stdio.h> int main() { int i,j,h,space,x; printf("n Enter the height: "); scanf("%d",&h); for(i=1;i<=h;i++) { printf("n"); for(space=1;space<=(h-i);space++) printf(" "); for(j=1;j<=((2*i)-1);j++) { printf("* "); } }

Coding Question 16 Read More »