Join Regular Classroom : Visit ClassroomTech

coding question

Coding Question 45

Write a C-program to implement binary searching. #include <stdio.h> int main() { int c, first, last, middle, n, search, array[100]; printf("Enter number of elementsn"); scanf("%d",&n); printf("Enter %d integersn", n); for (c = 0; c < n; c++) scanf("%d",&array); printf("Enter value to findn"); scanf("%d", &search); first = 0; last = n – 1; middle = (first+last)/2; […]

Coding Question 45 Read More »

Coding Question 26

Write C program to solve: xsin(x) #include<stdio.h> #include<math.h> #define PI 3.14159 int main() { int n; float x,value; printf("n Enter the angle in degree: "); scanf("%d",&n); x = n * (PI/180); value=x*sin(x); printf("n %.2f",value); return 0; } Join Our Telegram Group Visit our Facebook Page Coding Questions Coding Question :  Write a complete C program

Coding Question 26 Read More »

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 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 »

C program to convert a given temperature in Centigrade scale to its equivalent Fahrenheit scale – Coding Question 1

Write a complete C program to convert a given temperature in Centigrade scale to its equivalent Fahrenheit scale. #include<stdio.h> int main() { float c,f; printf("n Enter the temperature in Celcius: "); scanf("%f",&c); f=((9*c)/5)+32; printf("n The temperature in Fahrenheit Scale: %.2f degree Fahrenheit",f); return 0; } Join Our Telegram Group Visit our Facebook Page Coding Questions

C program to convert a given temperature in Centigrade scale to its equivalent Fahrenheit scale – Coding Question 1 Read More »