Answers:
Assignments are only for self-assessment. If you have any specific question related to this tutorial please post here.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,sq;
printf("enter the number :");
scanf("%d",&n);
sq=n*n;
printf("square of a number=%d",sq);
getch();
}
output :
enter the number : 3
square of a number=9
#include<stdio.h>
#include<conio.h>
void main()
{
int n,square;
printf("enter a number:");
scanf("%d",&n);
square=n*n;
printf("square of a number=%d",square);
getch();
}
output
enter a number:7
square of a number=49
#include<stdio.h>
#include<conio.h>
void main()
{
int n,square;
printf("enter a number:");
scanf("%d",&n);
square=n*n;
printf("square of a number=%d",square);
getch();
}
output
enter a number:7
square of a number=49
#include<stdio.h>
#include<conio.h>
void main()
{
int n,square;
printf("enter a number:");
scanf("%d",&n);
square=n*n;
printf("square of a number=%d",square);
getch();
}
output
enter a number:6
square of a number=36
#include<stdio.h>
#include<conio.h>
void main()
{
int n,square;
printf("enter a number:");
scanf("%d",&n);
square=n*n;
printf("square of a number=%d",square);
getch();
}
output
enter a number:7
square of a number=49
Login to add comment