Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions author- RIYA SINGHAL(1).c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#include <stdio.h>
int main()
{
int x;
int x,i;
printf("enter the no. to be divided");
scanf("%d",x);
for(int i=0;i<=5;i+=1)
scanf("%d",&x);
for(i=0;i<=5;i+=1)
{
int y=x/i;
printf("\n the quotient after dividing the given no. by %d is %d",i,y)
}
return 0;
}
}
7 changes: 3 additions & 4 deletions author- RIYA SINGHAL(3).c
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

#include <stdio.h>

int main()
{
int x=10;
for(int i=0;i<5;i-=1)
int x=10,i;
for(i=0;i<5;i+=1)
{
int x=9;
x=9;
printf("the value of x variable is %d",x);

}
Expand Down
Binary file added author- RIYA SINGHAL(3).exe
Binary file not shown.
13 changes: 6 additions & 7 deletions author- RIYA SINGHAL(4).c
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

#include <stdio.h>

int main()
{
int x=10;
for(int i=0;i<5;i-=1)//INFINITE LOOP
int x=10,i;
for(i=0;i<5;i+=1)//INFINITE LOOP
{
int x=9;
x=9;
printf("the value of x variable is %d",x);

}
char x;//ALREADY DECLARED ABOVE
char y;//ALREADY DECLARED ABOVE
printf("enter any character");
scanf("%c",&x);
printf("the entered character is %c",x);
scanf("%c",&y);
printf("the entered character is %c",y);
return 0;
}
Binary file added author- RIYA SINGHAL(4).exe
Binary file not shown.
10 changes: 6 additions & 4 deletions author- RIYA SINGHAL(5).c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

int main()
{
int x=10;
for(int i=0;i<5;i-=1){
int x=9;
printf(x);}
int x=10,i;
for(i=0;i<5;i+=1)
{
x=9;
printf("%d",x);
}
return 0;
}
Binary file added author- RIYA SINGHAL(5).exe
Binary file not shown.
15 changes: 8 additions & 7 deletions author-AKSHITA(2).c
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ int main()
printf("Enter an integer: ");
scanf("%d", &num);
temp=num;
while(temp!=0)
while(num!=0)
{
remainder=temp%10;
remainder=num%10;
reverse_num=reverse_num*10+remainder;
temp/=10;
if(reverse_num==num)
printf("%d is a palindrome number",num);
num/=10;
}
if(temp==reverse_num)
printf("%d is a palindrome number",temp);
else
print("%d is not a palindrome number",num);
printf("%d is not a palindrome number",temp);
return 0;
}
}
Binary file added author-AKSHITA(2).exe
Binary file not shown.
6 changes: 3 additions & 3 deletions author-ALI RAZA.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# include <stdio.h>
void fun(int &x)
void fun(int *x)
{
*x = 30;
}

int main()
{
int y = 20;
fun(y);
printf("%d", *y);
fun(&y);
printf("%d", y);
return 0;
}

Expand Down
Binary file added author-ALI RAZA.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion author-ALWINDER(1).c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void fun(int *p)
int main()
{
int r = 20;
int *p = &*r;
int *p = &r;
fun(p);
printf("%d", *&*&*p);
return 0;
Expand Down
Binary file added author-ALWINDER(1).exe
Binary file not shown.
3 changes: 2 additions & 1 deletion author-CHANDAN(1).c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ int main()
scanf("%d",&a);
printf("\nEnter value of b = ");
scanf("%d",&b);
sum=a+bsub=a-b;
sum=a+b;
sub=a-b;
printf("\nSum: %d\nSub: %d",sum,sub);
return 0;
}
Expand Down
Binary file added author-CHANDAN(1).exe
Binary file not shown.
11 changes: 7 additions & 4 deletions author-GURSANGAT(1).c
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# include <stdio.h>
int main()
{
int i = 0;
int i;
for (i=0; i<20; i++)
{
switch(i);
switch(i)
{
case 0:
i += 5;
break;
case 1:
i += 2;
break;
case 5:
i += 5;
break;
default:
i += 4;
break;
}
printf("%c "; i);
printf("%d ",i);
}
return 0;
}
}
Binary file added author-GURSANGAT(1).exe
Binary file not shown.
8 changes: 4 additions & 4 deletions author-GURSANGAT(2).c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include<stdi0.h>
#include<stdio.h>

int main()
{
char ch;
int i;
scanf("%c", i);
scanf("%d", ch);
printf("%c %d", &ch, &i);
scanf("%c", &ch);
scanf("%d", &i);
printf("%c %d", ch, i);
return 0;
}
Binary file added author-HIYA MADAN(2).exe
Binary file not shown.
32 changes: 16 additions & 16 deletions author-JASKIRAT SINGH(1).c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include<stdio.h>

void transpose(int arr[][],int n)
void transpose(int arr[][10],int n)
{
int tra[n][n],i,j;
for(i=0;i<n;i++)
Expand All @@ -17,29 +16,30 @@ void transpose(int arr[][],int n)
arr[i][j]=tra[i][j];
}
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t",arr[i][j]);
}
printf("\n");
}

}
int main()
{
int n,i,j;
int k,i,j;
printf("Enter the order of matrix\n");
scanf("%d",&n);
int arr[n][n];
scanf("%d",&k);
int arr[k][k];
printf("Enter the elements");
for(i=0;i<n;i++)
for(i=0;i<k;i++)
{
for(j=0;j<n;j++)
for(j=0;j<k;j++)
{
scanf("%d",&arr[i][j]);
}
}
transpose(arr,n);
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t",arr[i][j]);
}
printf("\n");
}
transpose(arr,k);
return 0;
}
Binary file added author-JASKIRAT SINGH(1).exe
Binary file not shown.
2 changes: 1 addition & 1 deletion author-JASKIRAT SINGH(2).c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ int main()
{
printf("division");
}
printf("%d",5/i);
printf("%d",i/5);
return 0;
}
Binary file added author-JASKIRAT SINGH(2).exe
Binary file not shown.
6 changes: 3 additions & 3 deletions author-PALAK AGRAWAL(1).c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <stdio.h>
int main()
{
int arr={23,45,132,90,345,1,45,8};
int sum=sum_arr(arr[],8);
int arr[]={23,45,132,90,345,1,45,8};
int sum=sum_arr(arr,8);
printf("Sum=%d",sum);
return 0;
}
int sum_arr(int arr[],int n)
{
int sum;
int sum=0,i;
for(i=0;i<n;i++)
{
sum=sum+arr[i];
Expand Down
Binary file added author-PALAK AGRAWAL(1).exe
Binary file not shown.
12 changes: 7 additions & 5 deletions author-PALAK AGRAWAL(2).c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <stdio.h>
int isprime(int n)
{
int i,f,c;
for(i=0;i<n;i++)
int i,f,c=1;
for(i=2;i<n;i++)
{
if(n%c==0)
if(n%i==0)
c++;
}
if(c==2)
Expand All @@ -15,15 +15,17 @@ int isprime(int n)
{
f=0;
}
return f;
}
int main()
{
int num;
printf("Enter a number:");
scanf("%d",num);
scanf("%d",&num);
int r=isprime(num);
if(r==1)
if(r==0)
printf("%d is prime",num);
else
printf("%d is not prime",num);
return 0;
}
Binary file added author-PALAK AGRAWAL(2).exe
Binary file not shown.
11 changes: 5 additions & 6 deletions author-RIYA SINGHAL(2).c
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

#include <stdio.h>
int Main()
int main()
{
int x,y;
Printf("enter the no. to be divided");
int x,y,i;
printf("enter the no. to be divided");
scanf("%d",&x);
for(int i=1;i<=5;i+=1);
for(i=1;i<=5;i+=1)
{
x+i=y;
y=x+i;
printf("\n the sum of given number with %d is %d",i,y);
}
return 0;
Expand Down
Binary file added author-RIYA SINGHAL(2).exe
Binary file not shown.
Binary file added author-SANCHAY JOSHI(1).exe
Binary file not shown.
4 changes: 2 additions & 2 deletions author-SANCHAY JOSHI(2).c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

int main()
{
int var = 2147483648;
long long var = 2147483648;
printf("Sanchay\n\n");
printf("Value of var = %d\n",var);
printf("Value of var = %lld\n",var);
return 0;
}
Binary file added author-SANCHAY JOSHI(2).exe
Binary file not shown.
Binary file added author-SHIVAM MAHAJAN(1).exe
Binary file not shown.
7 changes: 4 additions & 3 deletions author-SHIVAM MAHAJAN(2).c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
is equal to that number, the number is called Armstrong number. For example 153.
Sum of its divisor is 13 + 53;+ 33; = 1+125+27 = 153*/
#include <stdio.h>
#include<math.h>

void main(){
int num,r,sum,temp;
Expand All @@ -19,11 +20,11 @@ void main(){
sum = 0;

while(temp!=0){
r=temp / 10;
temp%=10;
r=temp % 10;
temp/=10;
sum=sum + pow(r,3);
}
if(sum=num)
if(sum==num)
printf("%d ",num);
}
printf("\n");
Expand Down
Binary file added author-SHIVAM MAHAJAN(2).exe
Binary file not shown.