Monday, 30 November 2015

File handling program for B.Tech(CSE) students

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

void main()
{
FILE* fp;
char ch;
fp=fopen("ABC.txt","w");
if(fp==NULL)
{
printf("File Doesn't exist");
exit(1);
}
fputs("Hello World",fp);
fclose(fp);
fp=fopen("ABC.txt","r");
if(fp==NULL)
{
printf("File Doesn't exist");
exit(1);
}
while(1)
{
ch=fgetc(fp);
if(ch==EOF)
{
break;
}
printf("%c",ch);
}
fclose(fp);
getch();
}

Monday, 23 November 2015

List of Practicals for B.Tech(CSE)-7th sem

Dear Students,

Find below the list of practicals to be included in practical record file. Further, lab internal examination will be held on 30th Nov. Bring your lab file on 30th and be prepared for viva-voce on the same date. Internal will be of 30 marks which will comprise your attendance, lab record file and your performance in the viva voce.


List of practical to be included in practical file:

1.         Write a C Program to demonstrate working of Lexical Analyzer.
2.         Write a C Program to check whether a string belongs to a grammar or not.
3.         Write a C Program to find leading terminals.
4.         Write a C Program to find trailing terminals.
5.         Write a C Program to compute follow of non terminals.
6.         Write a C Program to remove left factoring present in a grammar.
7.         Write a C Program to implement stack operations using linked list.
8.         Write a C program to count number of spaces and new lines.
9.         Write a C Program to show various operations i.e. read, write and modify in text file.
10.     Write a C Program to generate parse tree.

11.     Write a C Program to check whether a grammar is left recursive and remove left recursion.

Sunday, 15 November 2015

Thursday, 5 November 2015

List of Practicals for B.Tech(IT), 1st semester Students

Dear students,

Here is the list of practicals that should be contained in your FOC lab file. Each experiment must contain source code of the program and output obtained from sample run of the program. Practicals must be in the same order in which they have been given below.  Practical file must be submitted on or before 18th of November.


                                                    LIST OF PRACTICALS

1.         Write a program to perform swapping of values of two variables.
2.         Write a program to find whether an year entered by user is leap year or not.
3.         Write a program to print division of student using if-else and/or if-else if decision statements.  
4.         Write a program to find factorial of a number using FOR and WHILE loop.
5.         Write a function power(a,b) to calculate the value of a raised to power b.
6.         Write a function to compute area and parameter of a triangle. User should enter three sides of the triangle. Area and parameter should be printed in main.
7.         Write a function that receives marks received by a student in 3 subjects and returns the average and percentage of these marks. Call this function from main ( ) and print the results in main ( ).
8.         Write a program to search a particular element from an array. Also find number of times it appears in the array.
9.         Write a program to print array elements along with their address (using/without using) pointer.
10.     Write a function to modify values of an array to contain values which are 5 more than current values. Modified values should be printed in main ( ).
11.     Write a program to create a two dimensional array and print its elements using pointers.
12.     Write a program to find whether a string is palindrome or not. A string is said to be palindrome if we get the same string on reversing it. (For ex. “wow” is palindrome).
13.     Write a program to reverse a string. You may use a user defined function REVERSE( ) for this purpose.
14.     Write a user defined function XSTRLEN( ) for finding length of string.
15.        Write a program to show difference between structure and union. Program should differentiate based on following points:
(a) Size of structure and union variables.
(b) Memory addresses allocated to union and structure variables.
16.     Write a program to show use of array of structure. Program should allow user to enter details(name, age and roll) of five students and then print it. Structure variables should be used to enter details and pointer to structure should be used for printing the details.
17.     Write a program showing use of enumeration. Program should create a data type named ROLL which will take five values 0,1,2,3,4. Program should assign these values to variables of type ROLL and then print values of the variables. Program should also demonstrate usage of TYPEDEF.
18.     Write a program to show use of bit field. Program should print size of structure variable using (without using) bit field.