learn coding in c language
today i wrote a program in my leptop on dev c++.
here is the program i hope you like it.
(1) calculater.
#include<stdio.h>
int main()
{
int s1,s2,s3,s4,s5,sum,multiply,subtraction;
float per,divison;
printf("Enter Marks Of \n s1 = \n s2 =\n s3 =\n s4 = \n s5 = \n");
scanf("%d%d%d%d%d",&s1,&s2,&s3,&s4,&s5);
sum = s1 +s2 +s3 +s4 +s5;
multiply =s1*s2*s3*s4*s5;
subtraction = s1-s2-s3-s4-s5;
per =sum*100/500;
printf("Your sum is %d \n",sum);
printf("Your mult is %d \n",multiply);
printf("Your Subtraction is %d\n",subtraction);
printf("Your per is %f \n",per);
return 0;
}
(2) name in diagnol .
#include<stdio.h>
int main()
{
printf("\n\t My \n \t\tName \n \t\t\t Is \n\t\t\t\t muhammad\n\t \t\t \t \t hamza \n");
printf("\n\tI \n \t\tAm \n \t\t\t In \n\t\t\t\t BSSE \n \t \t\t \t \t 'A' \n\n\n");
}
(3) aski value in loop.
#include<stdio.h>
main()
{
int i,j;
char ch='a';
for(i=1;i<=3;i++){
for(j=1;j<=i;j++)
{
printf("%c\t",ch);
ch++;
}
ch='a';
printf("\n");
}
return 0;
}
Adding two no using function.
#include<stdio.h>
main()
{
int a,b,add;
printf("enter the value\n");
scanf("%d%d",&a,&b);
}
int add(int x,int y)
{ int c;
c=x+y;
printf("add=%d",c);
return (c);
}
()printing star & 6 digit between the star.
#include<stdio.h>
main()
{
int i,j,k;
printf("enter thed value\n");
scanf("%d",&k);
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
if(i==j)
{
printf("%d",k);
}
else
{
printf("*");
}
printf("\n");
}
return 0;
}
i hope you like my work . i start learning c language.
thanks
img credz: pixabay.com
Nice, you got a 74.0% @anu upgoat, thanks to @iwant
It consists of $1.1 vote and $0.37 curation
Want a boost? Minnowbooster's got your back!
The @OriginalWorks bot has determined this post by @iwant to be original material and upvoted(1.5%) it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
This post has received a 0.66 % 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.