Saturday 8 October 2016

6 comments:


  1. 1. Write a c program to reverse any number.
    2. Write a c program to find out sum of digit of given number.
    3. Write a c program to find out power of number.
    4. Write a c program to add two numbers without using addition operator.
    5. Write a c program to subtract two numbers without using subtraction operator.
    6. Write a c program to find largest among three numbers using binary minus operator.
    7. Write a c program to find largest among three numbers using conditional operator
    8. Write a c program to find out generic root of any number.
    9. Write a c program to find out prime factor of given number.
    10. Write a c program to find out NCR factor of given number.
    11. How to convert string to int without using library functions in c
    12. Program in c to print 1 to 100 without using loop
    13. C program for swapping of two numbers
    14. Program to find largest of n numbers in c
    15. Split number into digits in c programming
    16. C program to count number of digits in a number

    ReplyDelete
  2. Conversion ( Number System )

    1. Write a c program to convert decimal number to binary number.
    2. Write a c program to convert decimal number to octal number.
    3. Write a c program to convert decimal number o hexadecimal number.
    4. Write a c program to convert octal number to binary number.
    5. Write a c program to convert octal number to decimal number.
    6. Write a c program to convert octal number to hexadecimal number.
    7. Write a c program to convert hexadecimal number to binary number.
    8. Write a c program to convert hexadecimal number to octal number.
    9. Write a c program to convert hexadecimal number to decimal number.
    10. Write a c program to convert binary number to octal number.
    11. Write a c program to convert binary number to decimal number.
    12. Write a c program to convert binary number to hexadecimal number.
    13. C program for addition of binary numbers .
    14. C program for multiplication of two binary numbers.
    15. C program fractional binary conversion from decimal.
    16. C program for fractional decimal to binary fraction conversion.
    17. C program to convert decimal number to roman.
    18. C program to convert roman number to decimal number.
    19. C program to convert each digits of a number in words
    20. C program to convert currency or number in word.

    ReplyDelete
  3. 1.#include
    void main(){
    int a=5,b=10;
    clrscr();
    if(a<++a||b<++b)
    printf("%d %d",a,b);
    else
    printf("John Terry");
    }

    2. void main(){
    char c=256;
    char *ptr="Leon";
    if(c==0)
    while(!c)
    if(*ptr++)
    printf("%+u",c);
    else
    break;
    }

    3. #include
    void main(){
    int a=2;
    if(a--,--a,a)
    printf("The Dalai Lama");
    else
    printf("Jim Rogers");
    }

    4.
    #include
    void main(){
    int movie=1;
    switch(movie<<2+movie){
    default:printf("3 Idiots");
    case 4: printf(" Ghajini");
    case 5: printf(" Krrish");
    case 8: printf(" Race");
    }
    }




    5. #define L 10
    void main(){
    auto money=10;
    switch(money,money*2){
    case L: printf("Willian");
    break;
    case L*2:printf("Warren");
    break;
    case L*3:printf("Carlos");
    break;
    default: printf("Lawrence");
    case L*4:printf("Inqvar");
    break;
    }
    }
    6.#include
    void main(){
    int const X=0;
    switch(5/4/3){
    case X: printf("Clinton");
    break;
    case X+1:printf("Gandhi");
    break;
    case X+2:printf("Gates");
    break;
    default: printf("Brown");
    }
    }
    7.enum actor{
    SeanPenn=5,
    AlPacino=-2,
    GaryOldman,
    EdNorton
    };
    void main(){
    enum actor a=0;
    switch(a){
    case SeanPenn: printf("Kevin Spacey");
    break;
    case AlPacino: printf("Paul Giamatti");
    break;
    case GaryOldman:printf("Donald Shuterland");
    break;
    case EdNorton: printf("Johnny Depp");
    }}
    8. #include
    void main(){
    switch(6){
    case 6.0f:printf("Sangakkara");
    break;
    case 6.0: printf("Sehwag");
    break;
    case 6.0L:printf("Steyn");
    break;
    default: printf("Smith");
    }
    }
    9. #include
    void main(){
    switch(0X0){
    case NULL:printf("Thierry Henry");
    break;
    case '\0':printf("Steven Gerrend");
    break;
    case 0: printf("Kaka");
    break;
    default: printf("Michael Ballack");
    }

    }
    10. #include
    void main(){
    unsigned char c=280;
    switch(c){
    printf("Start\t");
    case 280:printf("David Beckham\t");
    case 24: printf("Ronaldinho\t");
    default: printf("Ronaldo\t");
    printf("End");
    }

    }







    11. #include
    void main(){
    static int i;
    int j;
    for(j=0;j<=5;j+=2)
    switch(j){
    case 1: i++;break;
    case 2: i+=2;
    case 4: i%=2;j=-1;continue;
    default: --i;continue;
    }
    printf("%d",i);
    }

    12. #include
    void main(){
    int x=3;
    while(1){
    switch(x){
    case 5/2: x+=x+++x;
    case 3%4: x+=x---x;continue;
    case 3>=3: x+=!!!x;break;
    case 5&&0:x+=~~~x;continue;
    default: x+=-x--;
    }
    break;
    }
    printf("%d",x);
    }
    13. #include
    void main(){
    switch(2){
    case 1L:printf("No");
    case 2L:printf("%s","I");
    goto Love;
    case 3L:printf("Please");
    case 4L:Love:printf("Hi");
    }
    }

    ReplyDelete
  4. String

    1. Write a c program to convert the string from upper case to lower case.
    2. Write a c program to convert the string from lower case to upper case.
    3. Write a c program to delete the all consonants from given string.
    4. Write a c program to count the different types of characters in given string.
    5. Write a c program to sort the characters of a string.
    6. Write a c program for concatenation two strings without using string.h header file.
    7. Write a c program to find the length of a string using pointer.
    8. Write a c program which prints initial of any name.
    9. Write a c program to print the string from given character.
    10. Write a c program to reverse a string
    11. Reverse a string using recursion in c
    12. String concatenation in c without using strcat
    13. How to compare two strings in c without using strcmp
    14. String copy without using strcpy in c
    15. Convert a string to ASCII in c

    ReplyDelete
  5. Frequently asked c programs in interview
    1. Write a c program to check given number is perfect number or not.
    2. Write a c program to check given number is Armstrong number or not.
    3. Write a c program to check given number is prime number or not.
    4. Write a c program to check given number is strong number or not.
    5. C program to check a number is odd or even.
    6. Write a c program to check given number is palindrome number or not.
    8. Write a c program to check given string is palindrome number or not.
    7. Write a c program to solve quadratic equation.
    8. Write a c program to print Fibonacci series of given range.
    9. Write a c program to get factorial of given number.
    10. Write a c program for Floyd’s triangle.
    11. Write a c program to print Pascal triangle.
    12. Write a c program to generate multiplication table.
    13. Write a c program to print ASCII value of all characters.
    14. C program to print hello world without using semicolon
    15. Write a c program which produces its own source code as its output

    For ans refer c questions.com

    ReplyDelete