outp

My Cart

Write program in C, for the following :a) To find the sum of digits i

Question


Write program in C, for the following : 
a) To find the sum of digits in an N digit number entered by the user, and print weather the final sum of digits is even or odd
b) To replicate strcpy() function of string.h header file
c) To convert decimal number enetered by the user into its equivalent Binary number.
d) To find the Largest and Smallest number in an unsorted array of integers, entered by the user.
e) To find count vowels and consonants present in any sentence entered by the user


Posted on : 2023-11-30 23:50:31 | Author : IGNOU Academy | View : 30

Click Here to Order on WhatsApp

Login or SignUp to View Answer / Comment or Ask Question.. Its Free

Word Count : 1259

a) Sum of Digits and Odd/Even Check in C:

```c
#include <stdio.h>

int main() {
    int n, sum = 0, digit;
    printf("Enter a number: ");
    scanf("%d", &n);
    
    // Calculating sum of digits
    while (n > 0) {
        digit = n % 10;
        sum += digit;
        n /= 10;
    }
    
    printf("Sum of digits: %d\n", sum);
    
    // Check if sum is even or odd
    if (sum % 2 == 0) {
        printf("The sum is even.\n");
    } else {
        printf("The sum is odd.\n");
    }
    
    return 0;
}
```

b) Replicating `strcpy()` Function in C:

```c
#include <stdio.h>

void myStrcpy(char *dest, const char *src) {
    while (*src != '\0') {
        *dest = *src;
        dest++;
        src++;
    }
    *dest = '\0'; // Null-terminate the destination string
}

int main() {
    char source[100], destination[100];
    printf("Enter a string: ");
    scanf("%s", source);
    
    myStrcpy(destination, _________ __________ ____________ _____________ ____________ __________ _________ ____ _________ ______ ___________.
__ __ ___________ ____ _____________ _____.
___________ _____________ _______ __ ______ _____________ ____________.
__________ __________ _____________ ___________ ___________ __ __ _________ __ ______ ___ ___ ___________.
__ _____________ ______ _____________ ______ _____________ _____________ ________ ___ __________ ____________ ________ __ ______ ___.
_________ ___ ________ ____________ _________ ___ ___________ ___ ____________.
___ _____________ _________ _______ _________ __________ __ __ ______ ____________.
_______ ______ ____ _____________ _____ _________ _______.
_____________ _____ ___________ __________ _____________ ________ _____ _______ ___ ________ _____________ ______ __________ _______.
___ ____ ________ ___________ ____________ _____________ ________ ____________ ______ _____ ______ _____ ____________.
________ ____ __ ___ _____________ ___ ___________ _____________ _____________ __________ _____ _____________ __ __.
__________ ______ _____________ ___ __ ____ _______ __________ ________ ___.
____ ________ _____ ___________ __________ ___________.
__________ ______ ____________ ____ ____________ __________ _____________ ___ _________.
____________ _____ ______ _______ _________ __________ __.
_____ _______ __________ ____ _____________ _____________ _____________ _________ _________ _________.
____ _________ _____ ___ ____ ________ _____ _________ _____ ____________ ____________ ___ ___.
_________ __________ ______ _______ __ ____ ____ __ _____.
_______ ___________ __ _____________ ______ ____ ______ _______ _________ _____.
_______ _____________ ____ ___________ __________ _________ _______ ____ _____________ ___________ _____ _________ _______ _____.
______ ____ _____ ______ ___ _________ ___________ __ _________.
______ ___________ ____________ __ _____________ ____________.
__ _________ __ ______ __ __________ _____________ _____________ ________.
_________ ___________ __ _________ _____________ _______ _____ ___.
________ ___________ ___ ____________ ____ ________ __ ________ ____ _____.
________ ____________ __ _____________ __ ______ ____________ ____________ __________ __ ______.
___ _____ _____ ___________ __________ _________ _________ _______ __ ______.
______ ___________ __________ __ _____________ _________ _____________ _____________ _________ __________ ________ ___ _________.
___ ___ __ _____________ ____ ____ __ ___ ___ _______ ___________ ____ _____ ____________ ___.
__________ __________ _____________ _____ ______ ____ ______ __ _________ _____ __________ ____ _______ __ _____.
_______ ____ ____ ____ _______ ___________ ____________ ____ __ ___________ _________ ________.
__________ ____________ ___ _______ _____ ________ _______ _______ ____________ ____ ____ ____ ______.
_________ ________ _____________ ____ ____ ____________ _____________ ____________ _____________ ___________ __ ______ _____________ ____________.
_____ ________ ____ _____ __________ __________ ____ _____ _______ _____________ __ _________ ____.
________ ____ ____ _____________ _____ ___________ _____ ___ ________ ____________ _______ __________ __________ ___________.
_________ _________ __________ _____ __ __.
_____________ ___ _______ _____________ ____ _____________ ________.
_________ __ ___________ ____________ _________ _____ ___________ __________ ___________ _________ _____.
_______ _________ ___ ___ ___________ ___ __ ___ ______ ___ ____ ___ ____ _______.
_____________ _____________ ____ ___ __________ ____ __________ ______ _____ _____ ____ __________.
_______ ____________ ___ _________ _________ __________.
______ _________ _________ _____ ___ _____________ ________ ________ _______.
__________ _____ ______ ______ ________ ____________ ___________ ____ __ ___________ __ ____.
__ _________ _____ ______ _____________ _______ _____ ____________ _____________.
__________ ___________ ____________ _____ _______ ___________ _______.
______ ___________ _______ __________ ____________ __ ________ ________ ___ ____________ ___________ __.
__________ ____________ __ _________ _____ _____ __.
____________ __________ ___ ____ ______ ______.
________ ____ ___________ __ ________ _________.
__ ____________ _____ ___________ ______ ____________ _____________ __ ________ ___________ __.
______ ________ ____ ____________ _______ __ ___ _______ _________ __________ __________ ____ ___ ______.
_________ __ _____________ ____________ __ ____________ _____________ __________ ____________.
_____________ ____ ___________ _________ _____________ ____ __________.
__________ _______ _____________ _____________ _____ ______ ___ ___________ ____ _________ __________.
_____ ____ ____ __________ _______ ___ ___________ __ __ ________ _______ __________ _______ ____________ _____.
_____________ ______ __ ________ ____ ____ __ _____ _________ _____ ______.
_____________ ____ ____ ___ ____________ ________ _________ _______ ___ ____ ______ ___________ ______ _________ ____________.
_____ __________ __________ _______ __________ ____ __ _______ _____ _____________ ____ _________.
_____________ ________ ___________ __ ___________ ____________ ____________ ____________ ___ ____________ ____________ ___ __.
____________ _________ __ ___ ______ ___ ____________ _________ _______ __________.
_______ _____________ _____________ _______ _________ ___________ ______ _____________ __ __________ _____ _____.
_______ __________ ____ ______ _____ __________ __ __________ _____________ ____________ ___________ ___ _____ _______.
___________ _____________ _____ _________ _________ _____________ _____________ _____ ______ ___________ ____ ___________.
__ ____________ __________ _____________ ___________ _______ _____ _______ ___________ _____ _______.
_____ __________ _______ __________ ____________ __________ ____ ____ ________ ___ _______.
________ ___ ____________ __________ _________ ______ _________ __ ____.
______ _____ ______ __ _______ _________ __________.
____ ____________ _______ __ ________ _______ __________ _____ _____________ ___ __________.
__________ _______ ___ ____________ _________ ___ _______ __________.
_______ __________ _________ _____________ __ ______ __ __________ __________ ________ ____ ___ ________ __________.
___ __ ___________ ___ _________ _________ __ ________ _________ _____________ ____ _____ _____ __ _________.
___________ ______ ______ _________ ________ ____ __ ________ __ _____.
__________ ____________ _________ _____________ ____________ ___________ __________ _____________ ______ __ _____________ ________ _______ ____________.
_____________ ____ ___ ____________ _______ ____ ____ __________ ____ ____.
___ ____ _____________ ___________ ________ ____________ __________ _____ ___________ ________ ________ ____.
___ _____ _____ _____________ __________ ________ _________ _____ _____ ___________ ________.
________ ___ _____ __ __ _____________ _________ ________ _____ ___________.
___________ __________ _____________ _______ _______ ___ ____ ______ ___________ ____ __________.
_____ _____________ __________ ________ _________ _______ __________ _______.
______ ___________ _____________ ___________ ______ _____________ _______ _____ ______ ___________ ___________ _________.
____________ ___ __ ___ ___ ___ ____ _________ __.
___ __________ ____________ _____ __ ___________ ________ ____ ________ _________.
_______ _____________ ____ ___ _________ __.
___ ___________ ______ ___ __________ ___________ ___ ___________ ____ ___________ ____________ ________ ___________.
____ ________ _______ ______ _____ ________ ____ ________ ______ ________ _____________ _____.
__________ __ ___ ______ __________ ________ ________ _____ ____ _____ __________.
__________ ___ ___________ _____________ ____________ ______ _______ ___________ ______ ___ ____________.
__ _________ ____ ____________ _________ ___________ ___________ ___________ ___ _______ ______ _____________ _________ _____ __________.
____ ___ ___ _____ _________ ______ ________ ________ ___ ____________ _____________ _________ __ _________ ______.
_______ ____ ____ ______ ______ ___________ ________ _______ _________ ____________ ___ ____________ ____________ _____________ ______.
_______ ____ __ _________ ________ _____________ ___________ ____ ______ __ _____________ ___________ __________ ________.
___________ ___ ___ ______ _____________ _____ ____ ___________ _____ ____________ __________ _____ ____________ ___________ __________.
_____ ________ ______ _______ ________ _____________ __________ ____ _______.
Click Here to Order Full Assignment on WhatsApp








Degree : PG DIPLOMA PROGRAMMES
Course Name : POST GRADUATE DIPLOMA IN COMPUTER APPLICATIONS
Course Code : PGDCA_NEW
Subject Name : C and PYTHON Lab
Subject Code : MCSL 205
Year : 2023



IGNOU MCSL 205 Solved Assignment 2023
Click Here to Order on WhatsApp

Related Question


Write Program to perform following tasks (10 Marks)
a. Create a database PRODUCT_SELECTION_DB
b. Set connection with mysql.connector.connect.

c. Create a table PRODUCT _SELECTION in database PRODUCT_SELECTION_DB with
following data PRODUCT_NAME,PRODUCT_PRICE, MANUFACTURER, EXPIRY_DATE.
d. change table structure / (add, edit, remove column of a table) at run time
i. add a column address in the PRODUCT_SELECTION table.
ii. execute SQL INSERT statement to create a record into PRODUCT _SELECTION table
iii. run the query to updates all the records having EXPIRY_DATE as 31-Dec-2022 and
increase PRICE of all the PRODUCTS by 10% of PRODUCT_PRICE.
iv. delete all the records from PRODUCT _SELECTION Table where EXPIRY_DATE is
before 31-Dec-2022.


Download any Dataset, then write a python code to read the downloaded dataset of your choice (April be CSV file) and print all features i.e. columns of the dataset. Determine the descriptive statistics i.e. Mean Median, Maximum, Minimum ,Range, Count, Variance, Standard Deviation etc. of the numeric features like age, marks, income etc., which April be present in the dataset.


Write program in C, for the following : 
a) To find the sum of digits in an N digit number entered by the user, and print weather the final sum of digits is even or odd
b) To replicate strcpy() function of string.h header file
c) To convert decimal number enetered by the user into its equivalent Binary number.
d) To find the Largest and Smallest number in an unsorted array of integers, entered by the user.
e) To find count vowels and consonants present in any sentence entered by the user


Using Structures write an interactive program in C language to create an application
program for a small school to maintain the Student_’s database. This application should
be having menu options like (10 Marks)
• Creating a New Record
• Reading/Listing of Records
• Modify the record
•Delete the record 

Each Student_ record should have Student_Name, Student_Roll_No., Student_Class, Student_Fees, Date of Admission, etc.). The application should be designed user-friendly.

Call Now
Contact Us
Welcome to IGNOU Academy

Click to Contact Us

Call - 9199852182 Call - 9852900088 myabhasolutions@gmail.com WhatsApp - 9852900088
New to IGNOU Login to Get Every Update