Posts

Showing posts from September, 2017

Placement Programs on C

1) Fibonacci Series Write a c program to print fibonacci series without using recursion and using recursion. Input: 10 Output: 0 1 1 2 3 5 8 13 21 34 #include<stdio.h> #include<conio.h> void main() { int n1=0,n2=1,n3,i,number; clrscr(); printf("Enter the number of elements:"); scanf("%d",&number); printf("\n%d %d",n1,n2);//printing 0 and 1 for(i=2;i<number;++i)//loop starts from 2 because 0 and 1 are already printed { n3=n1+n2; printf(" %d",n3); n1=n2; n2=n3; } getch(); } 2) Prime number Write a c program to check prime number. Input: 44 Output: not prime number Input: 7 Output: prime number #include<stdio.h>   #include<conio.h>   void main()   {   int n,i,m=0,flag=0;   clrscr();   printf("Enter the numbe...

Introduction to C Programming Language

C has been used successfully for every type of programming problem imaginable from operating systems to spreadsheets to expert systems - and efficient  compilers are available for machines ranging in power from the  Apple  Macintosh to the  Cray  supercomputers. The largest measure of C's success seems to be based on purely practical considerations: the portability of the compiler; the standard library concept; a powerful and varied repertoire of operators; an elegant syntax; ready access to the hardware when needed; and the ease with which applications can be optimised by hand-coding isolated procedures C is often called a "Middle Level" programming language. This is not a reflection on its lack of programming power but more a reflection on its capability to access the system's low level functions. Most high-level languages (e.g. Fortran) provides everything the programmer might want to do already built into the language. A low level language (e.g....
Syllabus 1) Introduction to C Language. 2) Keywords. 3)Data Types 4)......