diff --git a/author- RIYA SINGHAL(1).c b/author- RIYA SINGHAL(1).c index 0cf263e..5c21802 100644 --- a/author- RIYA SINGHAL(1).c +++ b/author- RIYA SINGHAL(1).c @@ -2,13 +2,13 @@ #include 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; -} \ No newline at end of file +} diff --git a/author- RIYA SINGHAL(3).c b/author- RIYA SINGHAL(3).c index 0057de6..208da7f 100644 --- a/author- RIYA SINGHAL(3).c +++ b/author- RIYA SINGHAL(3).c @@ -1,12 +1,11 @@ - #include 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); } diff --git a/author- RIYA SINGHAL(3).exe b/author- RIYA SINGHAL(3).exe new file mode 100644 index 0000000..984951b Binary files /dev/null and b/author- RIYA SINGHAL(3).exe differ diff --git a/author- RIYA SINGHAL(4).c b/author- RIYA SINGHAL(4).c index 7ae8bb8..0c030eb 100644 --- a/author- RIYA SINGHAL(4).c +++ b/author- RIYA SINGHAL(4).c @@ -1,18 +1,17 @@ - #include 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; } diff --git a/author- RIYA SINGHAL(4).exe b/author- RIYA SINGHAL(4).exe new file mode 100644 index 0000000..eb6b591 Binary files /dev/null and b/author- RIYA SINGHAL(4).exe differ diff --git a/author- RIYA SINGHAL(5).c b/author- RIYA SINGHAL(5).c index ba959fd..7c7225c 100644 --- a/author- RIYA SINGHAL(5).c +++ b/author- RIYA SINGHAL(5).c @@ -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; } diff --git a/author- RIYA SINGHAL(5).exe b/author- RIYA SINGHAL(5).exe new file mode 100644 index 0000000..84812e5 Binary files /dev/null and b/author- RIYA SINGHAL(5).exe differ diff --git a/author-AKSHITA(2).c b/author-AKSHITA(2).c index c0984f2..b8a72c7 100644 --- a/author-AKSHITA(2).c +++ b/author-AKSHITA(2).c @@ -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; -} \ No newline at end of file +} diff --git a/author-AKSHITA(2).exe b/author-AKSHITA(2).exe new file mode 100644 index 0000000..4cbae1c Binary files /dev/null and b/author-AKSHITA(2).exe differ diff --git a/author-ALI RAZA.c b/author-ALI RAZA.c index 665a17d..40f880a 100644 --- a/author-ALI RAZA.c +++ b/author-ALI RAZA.c @@ -1,5 +1,5 @@ # include -void fun(int &x) +void fun(int *x) { *x = 30; } @@ -7,8 +7,8 @@ void fun(int &x) int main() { int y = 20; - fun(y); - printf("%d", *y); + fun(&y); + printf("%d", y); return 0; } diff --git a/author-ALI RAZA.exe b/author-ALI RAZA.exe new file mode 100644 index 0000000..bc46629 Binary files /dev/null and b/author-ALI RAZA.exe differ diff --git a/author-ALWINDER(1).c b/author-ALWINDER(1).c index 77b51f5..a27f67b 100644 --- a/author-ALWINDER(1).c +++ b/author-ALWINDER(1).c @@ -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; diff --git a/author-ALWINDER(1).exe b/author-ALWINDER(1).exe new file mode 100644 index 0000000..40bdf7f Binary files /dev/null and b/author-ALWINDER(1).exe differ diff --git a/author-CHANDAN(1).c b/author-CHANDAN(1).c index d2f53db..8061f9d 100644 --- a/author-CHANDAN(1).c +++ b/author-CHANDAN(1).c @@ -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; } diff --git a/author-CHANDAN(1).exe b/author-CHANDAN(1).exe new file mode 100644 index 0000000..bb4edb4 Binary files /dev/null and b/author-CHANDAN(1).exe differ diff --git a/author-GURSANGAT(1).c b/author-GURSANGAT(1).c index 1faf009..237bfb1 100644 --- a/author-GURSANGAT(1).c +++ b/author-GURSANGAT(1).c @@ -1,22 +1,25 @@ # include 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; -} \ No newline at end of file +} diff --git a/author-GURSANGAT(1).exe b/author-GURSANGAT(1).exe new file mode 100644 index 0000000..34e439d Binary files /dev/null and b/author-GURSANGAT(1).exe differ diff --git a/author-GURSANGAT(2).c b/author-GURSANGAT(2).c index 2695849..464ee1e 100644 --- a/author-GURSANGAT(2).c +++ b/author-GURSANGAT(2).c @@ -1,11 +1,11 @@ -#include +#include 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; } diff --git a/author-HIYA MADAN(2).exe b/author-HIYA MADAN(2).exe new file mode 100644 index 0000000..2a90699 Binary files /dev/null and b/author-HIYA MADAN(2).exe differ diff --git a/author-JASKIRAT SINGH(1).c b/author-JASKIRAT SINGH(1).c index 9cd43ba..5e18c47 100644 --- a/author-JASKIRAT SINGH(1).c +++ b/author-JASKIRAT SINGH(1).c @@ -1,6 +1,5 @@ #include - -void transpose(int arr[][],int n) +void transpose(int arr[][10],int n) { int tra[n][n],i,j; for(i=0;i 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 int isprime(int n) { - int i,f,c; - for(i=0;i -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; diff --git a/author-RIYA SINGHAL(2).exe b/author-RIYA SINGHAL(2).exe new file mode 100644 index 0000000..8425746 Binary files /dev/null and b/author-RIYA SINGHAL(2).exe differ diff --git a/author-SANCHAY JOSHI(1).exe b/author-SANCHAY JOSHI(1).exe new file mode 100644 index 0000000..dba6c89 Binary files /dev/null and b/author-SANCHAY JOSHI(1).exe differ diff --git a/author-SANCHAY JOSHI(2).c b/author-SANCHAY JOSHI(2).c index d180938..a3624e7 100644 --- a/author-SANCHAY JOSHI(2).c +++ b/author-SANCHAY JOSHI(2).c @@ -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; } diff --git a/author-SANCHAY JOSHI(2).exe b/author-SANCHAY JOSHI(2).exe new file mode 100644 index 0000000..3b46075 Binary files /dev/null and b/author-SANCHAY JOSHI(2).exe differ diff --git a/author-SHIVAM MAHAJAN(1).exe b/author-SHIVAM MAHAJAN(1).exe new file mode 100644 index 0000000..1e88065 Binary files /dev/null and b/author-SHIVAM MAHAJAN(1).exe differ diff --git a/author-SHIVAM MAHAJAN(2).c b/author-SHIVAM MAHAJAN(2).c index f39e39a..3a58b9b 100644 --- a/author-SHIVAM MAHAJAN(2).c +++ b/author-SHIVAM MAHAJAN(2).c @@ -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 +#include void main(){ int num,r,sum,temp; @@ -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"); diff --git a/author-SHIVAM MAHAJAN(2).exe b/author-SHIVAM MAHAJAN(2).exe new file mode 100644 index 0000000..8f3431d Binary files /dev/null and b/author-SHIVAM MAHAJAN(2).exe differ