Write a program which take a integer from user and tell
whether the given variable is squar of some number or not.
eg: is this number is 1,4,9,16... or not
Answer Posted / manvi
main()
{
int i,b,j;
printf("enter the no");
scanf("%d",&i);
for(j=1;j<i;j++)
{
b=j*j;
if(i==b)
{
printf("this no is squre of: %d",j);
return;
}
}
printf("not a square no");
}
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What are shell structures used for?
How main function is called in c?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
What's the total generic pointer type?
provide an example of the Group by clause, when would you use this clause
Write a program with dynamically allocation of variable.
Why is c still so popular?
Where static variables are stored in memory in c?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
Can two or more operators such as and be combined in a single line of program code?
When c language was developed?
What is difference between && and & in c?
How is actual parameter different from the formal parameter?
What do you mean by recursion in c?
What are the differences between Structures and Arrays?