Wednesday, October 3, 2018


Assignment – 3



1.
What is the importance of pointers to pointers? Explain it with an example.
CO3
2.
Explain Basics of functions and its categories.
CO3
3.
Explain all Storage classes – auto, static, extern, register.
CO3
4.
What are various Dynamic memory management techniques? What are uses of them?
CO3
5.
Define Command line arguments. Write a program on Command line arguments.
CO3


Tutorial – 5

1.
How can you implement arrays with pointer? Explain it with an example.
CO3
2.
How can you implement strings with pointer? Explain it with an example.
CO3
3.
Explain Pre-processor directives, Macros with example programs.
CO3


Tutorial – 6

1.
Define Recursion? Function for factorial of a number using recursion.
CO3
2.
Is it possible to pass arrays as parameters to a function? If yes, pass an array of elements & return minimum element in the array.
CO3
3.
What is the importance of standard library functions? List out 10 standard library functions.
CO3

NCR Using Functions


#include<stdio.h>
#include<conio.h>

int power(int x, int n);
int factorial(int n);

int ncr(int n, int r)
{
    int ncr=1,i;
    for(i=0;i<r;i++)
        ncr=ncr*(n-i);
    ncr=ncr/factorial(r);
    return ncr;
}

void main()
{
    int exp,n,r,x;

    printf("\n\n\tEnter n, r, x values: ");
    scanf("%d%d%d",&n,&r,&x);

    exp=ncr(n,r)*power(x,n)/factorial(n);

    printf("\n\n\tExp = %d\n\n",exp);
    getch();
}

int power(int x, int n)
{
    int pow=1,i;
    for(i=1;i<=n;i++)
        pow=pow*x;
    return(pow);
}

int factorial(int n)
{
    int i,fact=1;
    for(i=1;i<=n;i++)
        fact=fact*i;
    return(fact);
}

Monday, September 24, 2018


Computer Programming(Assignment - 1 & 2)

Assignment – 1

1.
Design a flowchart for editing & executing C Programs.
CO1
2.
Define an algorithm? Write an algorithm for preparing various types tea & coffee.
CO1
3.
List out all operators. Describe the precedence of operators. 
CO1
4.
What is meant by a data type?  Explain about various data types in detail.
CO1
5.
Write a program that covers all selection statements.
CO1
6.
Distinguish between while, do-while and for loops in C with suitable examples.
CO1
7.
Explain all the importance of break, continue & goto statements.
CO1


Assignment – 2

1.
How an array is characterized?  How are they declared in C?
CO2
2.
List out some important operations performed on arrays.
CO2
3.
Write applications of arrays.
CO2
4.
Write a C program to perform the addition, subtraction & multiplication of two matrices using two & multi-dimensional arrays with necessary conditions.
CO2
5.
Write a C program to read a string and convert uppercase to lowercase & vice-versa.
CO2