Skip to content

Commit 5128fdc

Browse files
Merge branch 'kaal-coder:main' into main
2 parents 91b0ceb + 029c505 commit 5128fdc

File tree

114 files changed

+2567
-2305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2567
-2305
lines changed

Area of circle.c renamed to Coding/Area of circle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ area=pie*r*r;
99
printf("area of the circle is %f",area);
1010

1111
return 0;
12-
}
12+
}
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
//default constructor
2-
class A
3-
{
4-
int a; String b; boolean c;
5-
A()// if we comment out this constructor then all value will be given by compiler and it will be default value because it will create a default constructor
6-
{
7-
a=100; b="yash"; c=true;
8-
}
9-
void Disp()
10-
{
11-
System.out.println(a+" "+b+" "+c);
12-
}
13-
}
14-
class B
15-
{
16-
public static void main(String[] args) {
17-
18-
A r=new A();
19-
20-
r.Disp();
21-
22-
}
23-
24-
}
1+
//default constructor
2+
class A
3+
{
4+
int a; String b; boolean c;
5+
A()// if we comment out this constructor then all value will be given by compiler and it will be default value because it will create a default constructor
6+
{
7+
a=100; b="yash"; c=true;
8+
}
9+
void Disp()
10+
{
11+
System.out.println(a+" "+b+" "+c);
12+
}
13+
}
14+
class B
15+
{
16+
public static void main(String[] args) {
17+
18+
A r=new A();
19+
20+
r.Disp();
21+
22+
}
23+
24+
}
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
#include <stdio.h>
2-
#include <math.h>
3-
#include <conio.h>
4-
5-
int main()
6-
{
7-
int a, b;
8-
int sum, sub, mult, mod;
9-
float div;
10-
printf("enter the value of a ");
11-
scanf("%d", &a);
12-
printf("enter the value of b");
13-
scanf("%d", &b);
14-
sum = a + b;
15-
printf("\n add=%d", sum);
16-
sub = a - b;
17-
printf("\n sub=%d", sub);
18-
mult = a * b;
19-
printf("\n mul=%d", mult);
20-
div = (a)/(b);
21-
printf("\n div=%f", div);
22-
mod = a % b;
23-
printf("\n mod=%d", mod);
24-
25-
return 0;
1+
#include <stdio.h>
2+
#include <math.h>
3+
#include <conio.h>
4+
5+
int main()
6+
{
7+
int a, b;
8+
int sum, sub, mult, mod;
9+
float div;
10+
printf("enter the value of a ");
11+
scanf("%d", &a);
12+
printf("enter the value of b");
13+
scanf("%d", &b);
14+
sum = a + b;
15+
printf("\n add=%d", sum);
16+
sub = a - b;
17+
printf("\n sub=%d", sub);
18+
mult = a * b;
19+
printf("\n mul=%d", mult);
20+
div = (a)/(b);
21+
printf("\n div=%f", div);
22+
mod = a % b;
23+
printf("\n mod=%d", mod);
24+
25+
return 0;
2626
}
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
3-
4-
int main()
5-
{
6-
int n, i;
7-
printf("enter a number ");
8-
scanf("%d",& n);
9-
for (i = 2; i <= n; i++)
10-
{
11-
n % i != 0 ? printf("it is a prime number") : printf("it is a prime number");
12-
}
13-
return 0;
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
int main()
5+
{
6+
int n, i;
7+
printf("enter a number ");
8+
scanf("%d",& n);
9+
for (i = 2; i <= n; i++)
10+
{
11+
n % i != 0 ? printf("it is a prime number") : printf("it is a prime number");
12+
}
13+
return 0;
1414
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#include<stdio.h>
2-
3-
int main()
4-
{
5-
float fare,cels;
6-
printf("Enter the temperature in fahrenheit");
7-
scanf("fahrenheit=%f",&fare);
8-
cels=(fare - 32)*0.5;
9-
printf("the temperature in celsius is %f",cels);
10-
11-
return 0;
12-
}
1+
#include<stdio.h>
2+
3+
int main()
4+
{
5+
float fare,cels;
6+
printf("Enter the temperature in fahrenheit");
7+
scanf("fahrenheit=%f",&fare);
8+
cels=(fare - 32)*0.5;
9+
printf("the temperature in celsius is %f",cels);
10+
11+
return 0;
12+
}
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
2-
public class Customer {
3-
4-
public void stop() {
5-
}
6-
7-
public void start() {
8-
}
9-
10-
}
1+
2+
public class Customer {
3+
4+
public void stop() {
5+
}
6+
7+
public void start() {
8+
}
9+
10+
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#include<stdio.h>
2-
3-
int main()
4-
{
5-
int age=18;
6-
int*ptr=&age;
7-
int _age=*ptr;
8-
printf(" age %d",age);
9-
printf("\n *ptr %d",*ptr);
10-
printf("\n _age %d",_age);
11-
12-
return 0;
13-
14-
1+
#include<stdio.h>
2+
3+
int main()
4+
{
5+
int age=18;
6+
int*ptr=&age;
7+
int _age=*ptr;
8+
printf(" age %d",age);
9+
printf("\n *ptr %d",*ptr);
10+
printf("\n _age %d",_age);
11+
12+
return 0;
13+
14+
1515
}
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
#include<stdio.h>
2-
3-
int factorial(int n);
4-
5-
int main()
6-
{
7-
8-
int n,fact,i;
9-
printf("enter the number ");
10-
scanf("%d",&n);
11-
printf("factorial is %d",factorial(n));
12-
return 0;
13-
14-
}
15-
16-
int factorial(int n)
17-
{
18-
if(n==0)
19-
{
20-
return 1;
21-
}
22-
23-
int factnm1=factorial(n-1);
24-
int factn=factnm1 * n ;
25-
return factn;
26-
27-
}
28-
29-
30-
31-
32-
/* int i,n,fact;
33-
for(i=0;i<=n;i++)
34-
{
35-
fact=n*i;
36-
printf("%d",fact);
37-
38-
return fact;
39-
}*/
40-
1+
#include<stdio.h>
2+
3+
int factorial(int n);
4+
5+
int main()
6+
{
7+
8+
int n,fact,i;
9+
printf("enter the number ");
10+
scanf("%d",&n);
11+
printf("factorial is %d",factorial(n));
12+
return 0;
13+
14+
}
15+
16+
int factorial(int n)
17+
{
18+
if(n==0)
19+
{
20+
return 1;
21+
}
22+
23+
int factnm1=factorial(n-1);
24+
int factn=factnm1 * n ;
25+
return factn;
26+
27+
}
28+
29+
30+
31+
32+
/* int i,n,fact;
33+
for(i=0;i<=n;i++)
34+
{
35+
fact=n*i;
36+
printf("%d",fact);
37+
38+
return fact;
39+
}*/
40+
4141

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#include<stdio.h>
2-
3-
int main()
4-
{
5-
int num;
6-
printf("enter the num");
7-
scanf("%d",&num);
8-
if(num>0)
9-
{
10-
printf("the given number is positive");
11-
}
12-
else
13-
{
14-
printf("the given number is negative");
15-
}
16-
return 0 ;
1+
#include<stdio.h>
2+
3+
int main()
4+
{
5+
int num;
6+
printf("enter the num");
7+
scanf("%d",&num);
8+
if(num>0)
9+
{
10+
printf("the given number is positive");
11+
}
12+
else
13+
{
14+
printf("the given number is negative");
15+
}
16+
return 0 ;
1717
}
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#include<stdio.h>
2-
3-
int main()
4-
{
5-
int a,b;
6-
printf("enter the value of a ");
7-
scanf("%d",&a);
8-
printf("entefr the value of b");
9-
scanf("%d",&b);
10-
if(a>b)
11-
{
12-
printf("a is greater than b");
13-
else
14-
{
15-
printf("b is greater than a");
16-
}
17-
}
18-
return 0;
1+
#include<stdio.h>
2+
3+
int main()
4+
{
5+
int a,b;
6+
printf("enter the value of a ");
7+
scanf("%d",&a);
8+
printf("entefr the value of b");
9+
scanf("%d",&b);
10+
if(a>b)
11+
{
12+
printf("a is greater than b");
13+
else
14+
{
15+
printf("b is greater than a");
16+
}
17+
}
18+
return 0;
1919
}

0 commit comments

Comments
 (0)