Coding in c
(1) Square:put any no & get square
This programe is written in c language, using function.
#include<stdio.h>
int sq(void);
main()
{
int y;
y=sq();
printf("y=%d",y);
}int sq(void)
{
int s;
printf("enter the value\n");
scanf("%d",&s);
return (s*s);
}
(2) #include<stdio.h>
int main()
{
int i,j,r,c;
printf("entyer the vALUE\n");
scanf("%d%d",&r,&c);
for(i=0;i<=r;i++)
{
for(j=0;j<=c;j++)
{
printf ("(%d,%d)", i, j);
}
printf ("\n");
}
return 0;
}
(3) printing pattern star:
#include<stdio.h>
main()
{
int i,j,st;
for(i=1;i<=5;i++)
{
for(j=1;j<=5-i;j++)
{
printf("-");
}for(st=1;st<=i;st++){
printf("*");
}printf("\n");
}
return 0;
}
@driva has voted on behalf of @minnowpond.
If you would like to recieve upvotes from minnowponds team on all your posts, simply FOLLOW @minnowpond.
img credz: pixabay.com
Nice, you got a 82.0% @onealfa upgoat, thanks to @iwant
It consists of $1.06 vote and $0.05 curation
Want a boost? Minnowbooster's got your back!
nice
This post has received a 0.77 % upvote from @boomerang thanks to: @iwant
@boomerang distributes 100% of the SBD and up to 80% of the Curation Rewards to STEEM POWER Delegators. If you want to bid for votes or want to delegate SP please read the @boomerang whitepaper.