Friday, August 29, 2014

Write a program that asks the user to input a number. The program displays the square of that number


Code

#include<stdio.h>
int main()
{
int a,c;

printf ("Enter value of a:");
scanf ("%d",&a);

c = a*a;

printf ("\n\nAnswer= %d",c);

printf ("\n\npress any key to close.");

getch ();
return 0;
}

Output

C Language digit's square

No comments :

Post a Comment

Note: Only a member of this blog may post a comment.

Copyright 2017. All Rights Reserved. Privacy Policy / Terms And Conditions / Sitemap / Contact