Q. Write a C program to accept a number from user and print the square of number. Also draw the flowchart of program.
Ans.
/*c program to calculate the square of number*/
#include<stdio.h>
int main()
{
double n,z;
printf("Enter any number : ");
scanf("%lf", &n);
z = n * n;
printf("Square of number %lf*%lf = %lf",n,n,z);
return 0;
}
The output of above program would be:
Enter any number : 25
Square of number 25*25 = 625
Flowchart of above C square number program:
Related programs:
Ans.
/*c program to calculate the square of number*/
#include<stdio.h>
int main()
{
double n,z;
printf("Enter any number : ");
scanf("%lf", &n);
z = n * n;
printf("Square of number %lf*%lf = %lf",n,n,z);
return 0;
}
The output of above program would be:
Enter any number : 25
Square of number 25*25 = 625
Flowchart of above C square number program:
Figure : Flowchart for square number C program |
Related programs:
Write a C program to accept a number from user and print the sum of square. Also draw the flowchart of program.
ReplyDeleteYour required sum of square C program, algorithm and flowchart at:
Deletehttp://cprogrammingcodes.blogspot.in/2012/10/sum-of-square-program-algorithm-and.html
write a c program that input 4 digit number and giving output its reverse order for example the no is 1234 it shows as 4321. also draw its flow chart
ReplyDeleteAkhil
ReplyDeleteAre Flowcharts necessary for an experenced iphone Programmer?
ReplyDelete