Total Pageviews

Tuesday, January 6, 2026

ARITHMETIC OPERATOR IN R LANGUAGE ( USING TWO FLOAT VALUES )

 ARITHMETIC OPERATOR IN R LANGUAGE (  USING TWO FLOAT VALUES ) 


ARITHMETIC OPERATOR IN R LANGUAGE ( USING TWO INTEGER VALUES ) -

 ARITHMETIC OPERATOR IN R LANGUAGE (  USING TWO INTEGER VALUES ) - 



ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE

 ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE



ASSIGN 2 VALUES USING = OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE

 ASSIGN 2 VALUES USING = OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE




ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM USING CAT() IN R LANGUAGE

  ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM USING CAT() IN R LANGUAGE




ASSIGN 2 VALUES USING <- OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE

 
ASSIGN 2 VALUES USING <- OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE



Tuesday, December 2, 2025

Realloc

 #include <stdio.h>

#include <stdlib.h> 

int main() {

    int *ptr;

    int n = 5,m;

    printf("Enter number of values:\n");

    scanf("%d",&n);

    ptr = (int *)calloc(n, sizeof(int));

    if (ptr == NULL) {

        printf("Memory allocation failed!\n");

        return 1; 

    }

    printf("\n");

    for (int i = 0; i < n; i++) {

        ptr[i] = i *10+10;

    }

    printf("After assigning values:\n");

    for (int i = 0; i <n ; i++) {

        printf("%d ", ptr[i]); 

    }

    printf("\n");

    printf(" values with extra index:\n");

    for (int i = 0; i <n +5; i++) {

        printf("%d ", ptr[i]); 

    }

    

    

    m=n+5;

     ptr = (int *)calloc(m, sizeof(int));

            printf("\n");

        printf("After realloc values:\n");

    for (int i = 0; i <m ; i++) {

        printf("%d ", ptr[i]); 

    }

    return 0;

}


Calloc and free

 #include <stdio.h>

#include <stdlib.h> 

int main() {

    int *ptr;

    int n = 5;

    printf("Enter number of values:\n");

    scanf("%d",&n);

    ptr = (int *)calloc(n, sizeof(int));

    if (ptr == NULL) {

        printf("Memory allocation failed!\n");

        return 1; 

    }

    printf("\n");

    for (int i = 0; i < n; i++) {

        ptr[i] = i *10+10;

    }

    printf("After assigning values:\n");

    for (int i = 0; i <n ; i++) {

        printf("%d ", ptr[i]); 

    }

    printf("\n");

    printf(" values with extra index:\n");

    for (int i = 0; i <n +5; i++) {

        printf("%d ", ptr[i]); 

    }

    free(ptr);

       

         printf("\n");

        printf("After free values:\n");

    for (int i = 0; i <n ; i++) {

        printf("%d ", ptr[i]); 

    }

    return 0;

}


calloc 2

 //calloc


#include <stdio.h>

#include <stdlib.h> 

int main() {

    int *ptr;

    int n = 5;

    printf("Enter number of values:\n");

    scanf("%d",&n);

    

    ptr = (int *)calloc(n, sizeof(int));


    if (ptr == NULL) {

        printf("Memory allocation failed!\n");

        return 1; 

    }


   

    printf("\n");


   

    for (int i = 0; i < n; i++) {

        ptr[i] = i *10+10;

    }


    printf("After assigning values:\n");

    for (int i = 0; i < 10; i++) {

        printf("%d ", ptr[i]); 

    }

    printf("\n");


   

    free(ptr);

    ptr = NULL; 


    return 0;

}


Tuesday, November 25, 2025

Calloc

 //calloc


#include <stdio.h>

#include <stdlib.h> 

int main() {

    int *ptr;

    int n = 5;

    printf("Enter number of values:\n");

    scanf("%d",&n);

    

    ptr = (int *)calloc(n, sizeof(int));


    if (ptr == NULL) {

        printf("Memory allocation failed!\n");

        return 1; 

    }


   

    printf("\n");


   

    for (int i = 0; i < n; i++) {

        ptr[i] = i *10+10;

    }


    printf("After assigning values:\n");

    for (int i = 0; i < n; i++) {

        printf("%d ", ptr[i]); 

    }

    printf("\n");


   

    free(ptr);

    ptr = NULL; 


    return 0;

}