how to programme using switch statements and fuctions, a
programme that will output two even numbers, two odd numbers
and two prime numbers of the users chioce.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Code Interview Questions

Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,


main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }

1 Answers  


how can i cast a char type array to an int type array

2 Answers  


main() { int i=5,j=6,z; printf("%d",i+++j); }

2 Answers  


Give a one-line C expression to test whether a number is a power of 2.

10 Answers   Microsoft,






In a gymnastic competition, scoring is based on the average of all scores given by the judges excluding the maximum and minimum scores. Let the user input the number of judges, after that, input the scores from the judges. Output the average score. Note: In case, more than two judges give the same score and it happens that score is the maximum or minimum then just eliminate two scores. For example, if the number of judges is 5 and all of them give 10 points each. Then the maximum and minimum score is 10. So the computation would be 10+10+10, this time. The output should be 10 because 30/3 is 10.

0 Answers   TCS,


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).

1 Answers  


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


Categories