Monday, May 24, 2010

How to test my skills in C language?plz send me some critical programes for solving.?

The real test is employment!

How to test my skills in C language?plz send me some critical programes for solving.?
Can you design a game of Chess using C language.





Yes, it is possible. My friend did this in 3 days (for a competition in the training institute that we studied)
Reply:try to make program like for shops,hotels,school and all commercial place u find and another way is to do job.





But if u realy want to test ur skill in c laguage try to make KEYLOGGER software for windows wista or linux.
Reply:before going to employment, test your logic first....





Create a program of two variables with two values that will switch the two values from one another like if Var1=12 and Var2=5 it would be Var1=5 and Var2=12 after the program is run.





Rules:


No special C function except printf and var declarations.


No adding of variables. Use the two variables only.


No loopings.





This is a simple one but will test your logic.





Once youre done, I agree to create a Chess game of 2-player mode and can be played by a Human against the Computer.





It that is easy, create a virus program that will save on the CMOS and it will stay there even if the hard disk got formatted and continously infect it.
Reply:#1





What would be the output of the following:





main( )


{


int a[10] ;


printf ( "%u %u", a, %26amp;a ) ;


}


#2





Point out the error, if any in the following program.





main( )


{


extern int i ;


i = 20 ;


printf ( "%d", sizeof ( i ) ) ;


}


#3





Point out the error in the following program. How would you avoid it ?





main( )


{


struct emp


{


char n[20] ;


float s ;


};


struct emp e[10] ;


int i ;





printf ( "Enter the names and salaries of employees\n" ) ;





for ( i = 0 ; i %26lt;= 9 ; i++ )


scanf ( "%s%f", e[i].n, %26amp;e[i].s ) ;


}


#4





What would be the output of the following:





main( )


{


int a[3][4] = { 1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0 } ;


printf ( "\n %u %u", a + 1, %26amp;a + 1 ) ;


}


#5





Is the expression a[b[c[d[1]]]] legal?








#6





Consider the following program segment.





main( )


{


int a = 5, b = 10 ;


P ( a ) ;


P ( b ) ;


}





Define the macro P such that the output of the program comes out to be





a = 5


b = 10





#7Suppose you have written two functions f( ) and g( ). How would you add them to the standard library?








#8Suppose a function f( ) has been defined in file 'file1.h'. If we #9include this file twice a redefinition of function would occur. How would you avoid it?








#10Suppose your executable (.EXE ) files have been deleted accidentally and if you want to copy all executable files to the specified directory, you have to recompile all the files. This process would be cumbersome. How would you compile all the files in a single pass.








#11There is a function f( ). Sometimes we have to pass 4 arguments to this function and sometimes else 7 arguments. If the purpose of the function f( ) is to only print all the arguments that it receives, how would you write function f( )?








#12Write a program to reverse a given linked list.








#13Suppose a file 'emp.dat' consists of 10 dates. Write a program to sort and print the sorted dates on the screen.











#14All possible combinations of 1, 2, 3 are 1 2 3, 1 3 2, ... These turn out to be 3! combinations. If we take 4 numbers, there would be 4! combinations. If we take n numbers, there would be n combinations. If n is received from keyboard, write a program to generate and print these combinations.





#15Write a program to add two matrices of dimensions 3 x 4. Each element of the two matrices is a complex number.





#16 Write a program to generate 10 different random numbers?





#17 Write a program to arrange the queens on a 8 x 8 chess board so that no one can take the other and print the arrangements of possible combinations.





#18Write a program 'evaluate.c' to accept an arithmetic expression as string on the command line and find the value of the expression. For example, evaluate 3 + 5 * 2 should output 13.





#19 A magic square is an n x n matrix, where each of the integers 1, 2, 3, ..., n, appear exactly once and the sums of every row, column and diagonal are equal. Here is a magic square for n = 3:





8 1 6





3 5 7





4 9 2





The following is a procedure for constructing an n x n magic square for any odd integer n.


Place initial number, say k, in the middle of the top row. Then after integer k has been placed, move up one row and one column to the right to place the next integer k + 1, unless one of the following occurs:


(a) If a move takes you above the top row in the j th column, move to the bottom of the j th column and place the integer there.


(b) If a move takes you outside to the right of the square in the i th row, place the integer in the i th row at the left side.


(c) If a move takes you to an already filled square, place k + 1 immediately below k.





Write a program to construct a magic square for any odd integer n.





#20Accept two dates and the day of the first date from the keyboard. Write a program to determine and print the day of the other date.





#21 Write a program that converts the numeric figures into the words. For example, 123 should be printed as , One Hundred Twenty Three.





#22 Pascal triangle's elements are the Binomial coefficients and can be calculated from the formula:





n!/ ( ( n - r )! * r! ).


Write a program to print the pascal's triangle without using the formula or arrays.





#23 Write a program to print the calendar, which is constrained to only 5 rows as:





Januray 2007





su-mo-tu-we-th-fr-sa


---- 01 02 03 04 05 06


07 08 09 10 11 12 13


14 15 16 17 18 19 20


21 22 23 24 25 26 27


28 29 30 31





#24 Write a program to find the determinant value of any given square matrix using recursion.








#25 Write a program to compare two binary search trees using recursion.








# 26Write a program to compare two linked lists using recursion.
Reply:Does C supports METHOD OVERLOADING?? Think carefully

calling cards

No comments:

Post a Comment