C Interview Questions
Questions Answers Views Company eMail

write a program in c to find out the sum of digits of a number.but here is a condition that compiler sums the value from left to right....not right to left..

1 1321

Write a program to maintain student’s record. Record should not be available to any unauthorized user. There are three (3) categories of users. Each user has its own type. It depends upon user’s type that which kind of operations user can perform. Their types and options are mentioned below: 1. Admin (Search Record [by Reg. No or Name], View All Records, Insert New Record, Modify Existing Record) 2. Super Admin (Search Record [by Reg. No or Name], View All Records, Insert New Record, Modify Existing Record, Delete Single Record) 3. Guest (Search Record [by Reg. No or Name], View All Records) When first time program runs, it asks to create accounts. Each user type has only 1 account (which means that there can be maximum 3 accounts). In account creation, following options are required: Login Name: <6-10 alphabets long, should be unique> Password: <6-10 alphabets long, should not display characters when user type> Confirm Password: Account Type: Login Name, Password and Account Type should be stored in a separate file in encrypted form. (Encryption means that actual information should be changed and Decryption means that Encrypted information is changed back to the actual information) If any of the above mentioned requirement(s) does not meet then point out mistake and ask user to specify information again. When Program is launched with already created accounts, it will ask for user name and password to authenticate. On successful authentication, give options according to the user’s type.


main() { int i = 10; printf(" %d %d %d \n", ++i, i++, ++i); }

TCS, Vector,

8 12364

c language interview questions & answer


What is the difference between realloc() and free()

1 1442

int a=20; int b=30; int c=40; printf("%d%d%d"); what will be the output?


5 3552

input any 4 digit number and find the difference of all the digits?


3 1688

Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?



What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }



what is the purpose of the following code, and is there any problem with the code? void fn(long* p1, long* p2) { register int x = *p1; register int y = *p2; x ^= y; y ^= x; x ^= y; *p1 = x; *p2 = y; }


1 2188

what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }


2 1556

What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return –n & 7; }


1 1826

what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }


1 1749

what is the purpose of the code, and is there any problem with it. unsigned int v[10]; unsigned int i = 0; while (i < 10) v[i] = i++;


2 1903

Identify the operators that is not used with pointer a. && b. # c. * d. >>

2 2436

Post New C Questions

Un-Answered Questions { C }

What is the difference between if else and switchstatement


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.


how is the examination pattern?


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.


a program that can input number of records and can view it again the record


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.


a c code by using memory allocation for add ,multiply of sprase matrixes


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }


all c language question


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.


i got 75% in all semester am i eligible for your company