Join Regular Classroom : Visit ClassroomTech

Coding Questions

Program to check a number is palindrome or not – Coding Question 10

Write a program to check a number is palindrome or not.  #include<stdio.h> int main() { int num,temp,sum=0,r; printf("n Enter a number: "); scanf("%d",&num); temp=num; while(num!=0) { r=num%10; sum=sum*10+r; num=num/10; } printf("n Reverse No. of %d= %d",temp,sum); if(sum==temp) printf("n %d is a pallindrome no.",temp); else printf("n %d is not a pallindrome no.",temp); return 0; } Join […]

Program to check a number is palindrome or not – Coding Question 10 Read More »

Program to find the sum of the digits of a number – Coding Question 9

Write a program to find the sum of the digits of a number. #include<stdio.h> int main() { int num,temp,sum=0,r; printf("n Enter a number: "); scanf("%d",&num); temp=num; while(num!=0) { r=num%10; sum+=r; num=num/10; } printf("n Sum of Digits of %d= %d",temp,sum); return 0; } Join Our Telegram Group Visit our Facebook Page Coding Questions Coding Question : 

Program to find the sum of the digits of a number – Coding Question 9 Read More »

Program in C to find the roots of a quadratic equation – Coding Question 7

Write a program in C to find the roots of a quardratic equation. Your program should print the imaginary roots in the form a+ib. #include<stdio.h> #include<math.h> int main() { int a,b,c; float x,root1,root2,real,img; printf("n Enter the value of a: "); scanf("%d",&a); printf("n Enter the value of b: "); scanf("%d",&b); printf("n Enter the value of c:

Program in C to find the roots of a quadratic equation – Coding Question 7 Read More »

program to generates all combinations of 1,2 and 3 using for loop – Coding Question 6

Write a program to generates all combinations of 1,2 and 3 using for loop. #include<stdio.h> int main() { int i,j,k,z=1; printf("n All the combinations are as follows: "); for(i=1;i<=3;i++) for(j=1;j<=3;j++) for(k=1;k<=3;k++) printf("n%02d. %d %d %d",z++,i,j,k); return 0; } Join Our Telegram Group Visit our Facebook Page Coding Questions Coding Question :  Write a complete C

program to generates all combinations of 1,2 and 3 using for loop – Coding Question 6 Read More »

C program to accept three integer numbers as the length of three sides of a triangle test the validity of lengths and classify the triangle – Coding Question 5

Write a C program to accept three integer numbers as the length of three sides of a triangle , test the validity of lengths and classify the triangle. #include<stdio.h> int main() { int a,b,c; printf("n Enter the 1st Side of the triangle: "); scanf("%d",&a); printf("n Enter the 2nd Side of the triangle: "); scanf("%d",&b); printf("n

C program to accept three integer numbers as the length of three sides of a triangle test the validity of lengths and classify the triangle – Coding Question 5 Read More »

C program to print a pattern – Coding Question 4

Write a C program to print the following pattern(till n rows, where n is taken as input). #include<stdio.h> #include<math.h> int main() { int i,j,h,space,x=1; 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<=i;j++) { printf("%d ",x); x=1-x; } } return 0; } Join Our Telegram Group Visit our Facebook Page Coding

C program to print a pattern – Coding Question 4 Read More »

check a number whether it is odd or even by bitwise operato – Coding Question 3

Write a program to check a number whether it is odd or even by bitwise operator. #include<stdio.h> int main() { int a,b; printf("n Enter the a Number: "); scanf("%d",&a); b= a & 1; // Not Necessary only to check printf("n Resultant = %d",b); // Even odd Checking if(b) printf("n %d is odd",a); else printf("n %d

check a number whether it is odd or even by bitwise operato – Coding Question 3 Read More »

Swap the value of 2 variable without using any additional variable – Coding Question 2

Write a function to swap the value of 2 variable without using any additional variable. The change should be permanent. #include<stdio.h> int main() { int a,b; printf("n Enter the 1st Number: "); scanf("%d",&a); printf("n Enter the 1st Number: "); scanf("%d",&b); a=a+b; b=a-b; a=a-b; printf("n First Number = %d",a); printf("n Second Number = %d",b); return 0;

Swap the value of 2 variable without using any additional variable – Coding Question 2 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 »