Free download Computer Programming (CP) 2014 Previous Year Question Paper as pdf for B.Tech Civil engineering.
Course : BTech Engineering course (degree)
University: MG University (Mahatma Gandhi University)
Semester: Fifth Semester (5th) (s5)
Subject: CE 010 502- Computer programming (CP) (C programming)
Information about resetting and configuring Mobile phones (Java, Android, Symbian etc), educational articles especially for programming in C, C++ and Java and more about Computers and operating systems
Showing posts with label computer programming. Show all posts
Showing posts with label computer programming. Show all posts
Computer Programming Fifth semester previous year Question Paper for Civil
Labels:
$studymat
,
2014
,
BTech
,
computer programming
,
CP
,
download
,
engineering
,
Fifth semester
,
free
,
MG University
,
paper
,
pdf
,
previous
,
question
,
s5
,
sem
C program to Calculate Permutations and Combinations (nPr and nCr)
This is a C program to calculate total number of permutations and combinations for given values of n and r. This program calculates nPr and nCr using functions.
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
long double fact( int);
int ncr( int ,int);
long npr( int ,int);
main()
{
int n,r;
printf(" Enter value of n & r \n");
scanf("%d %d",&n ,&r);
if( n>= r)
{
printf( "%d C %d is %d \n",n,r,ncr( n ,r));
printf("%d P %d is %ld\n",n,r,npr( n, r));
}
else
{
printf("\n n should be greater than r");
getch ();
exit(0);
}
}
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
long double fact( int);
int ncr( int ,int);
long npr( int ,int);
main()
{
int n,r;
printf(" Enter value of n & r \n");
scanf("%d %d",&n ,&r);
if( n>= r)
{
printf( "%d C %d is %d \n",n,r,ncr( n ,r));
printf("%d P %d is %ld\n",n,r,npr( n, r));
}
else
{
printf("\n n should be greater than r");
getch ();
exit(0);
}
}
Subscribe to:
Posts
(
Atom
)