Coding in c

in #coding9 years ago (edited)

(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;

}

Sort:  

@driva has voted on behalf of @minnowpond.
If you would like to recieve upvotes from minnowponds team on all your posts, simply FOLLOW @minnowpond.

            To receive an upvote send 0.25 SBD to @minnowpond with your posts url as the memo
            To receive an reSteem send 0.75 SBD to @minnowpond with your posts url as the memo
            To receive an upvote and a reSteem send 1.00SBD to @minnowpond with your posts url as the memo

Calling @originalworks :)
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!

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.

Coin Marketplace

STEEM 0.05
TRX 0.33
JST 0.079
BTC 63953.57
ETH 1690.68
USDT 1.00
SBD 0.42