Stop Thinking Start Learning.
Home
Archives for August 2019
Friday, August 23, 2019
Pascal star Pattern in C language
Author Saumil Rana
publish August 23, 2019
Tags
Pascal star Pattern in C language:
*
* *
* * *
* * * *
* * * * *
* * * * *
* * * *
* * *
* *
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("* ");
}
printf("\n");
}
for(i=5;i>=1;i--)
{
for(j=5;j>=i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("* ");
}
printf("\n");
}
getch();
}
Tuesday, August 20, 2019
find a Square in a function. return type of function
Author Saumil Rana
publish August 20, 2019
Tags
Find a Square in a function. return type of function:
#include<stdio.h>
#include<conio.h>
float funret(float);
void main()
{
float i;
clrscr();
printf("Enter a Any Number:- ");
scanf("%f",&i);
funret(i);
getch();
}
float funret(float x)
{
float y;
y=x*x;
printf("The Square is:- %f",y);
return(y);
}
Output:
formal argument is changed in the calling funtion but currosponding chnge does not takeplace in the calling function.
Author Saumil Rana
publish August 20, 2019
Tags
Formal argument is changed in the calling funtion but currosponding chnge does not takeplace in the calling function:
#include<conio.h>
void fun(int);
void main()
{
int a=30;
clrscr();
printf("\nThe Output is:");
fun(a);
printf("\n%d",a);
getch();
}
void fun(int b)
{
b=60;
printf("\n%d",b);
}
Output:
How to sum in function.sending And Receving values between functions..how to pass argument in function.
Author Saumil Rana
publish August 20, 2019
Tags
How to sum in function.sending And Receving values between functions:
#include<stdio.h>
#include<conio.h>
int sum(int x,int y,int z); //argument
void main()
{
int a,b,c,sum1;
clrscr();
printf("Enter Any Three Numbers:- ");
scanf("%d%d%d",&a,&b,&c);
sum1=sum(a,b,c);
printf("the sum is:- %d",sum1);
getch();
}
int sum(int x,int y,int z)
{
int total;
total=x+y+z;
return(total);
}
Output:
Simple program how to define a function and call.
Author Saumil Rana
publish August 20, 2019
Tags
Simple program of how to define a function:
#include<stdio.h>
#include<conio.h>
void ahmedabad();
void rajkot();
void bhavnagar();
void main()
{
clrscr();
printf("\nI am in Main");
ahmedabad();
rajkot();
bhavnagar();
getch();
}
void ahmedabad()
{
printf("\nYou are in Ahmedabad");
}
void rajkot()
{
printf("\nYou are in Rajkot");
}
void bhavnagar()
{
printf("\nYou are in Bhavnagar");
}
Output:
Monday, August 19, 2019
Tuesday, August 13, 2019
This Program is mostly asked for interview.
Author Saumil Rana
publish August 13, 2019
Tags
This Program is mostly asked for interview:
*
***
*****
*******
*********
*********
*******
*****
***
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf("0");
}
for(k=1;k<=2*i-1;k++)
{
printf("*");
}
printf("\n");
}
for(i=5;i>=1;i--)
{
for(j=5;j>=i;j--)
{
printf("0");
}
for(k=1;k<=2*i-1;k++)
{
printf("*");
}
printf("\n");
}
getch();
}
Saturday, August 10, 2019
Thursday, August 8, 2019
Subscribe to:
Posts (Atom)