Submitted Questions

  • Shell Script to Add File Extension

    Write a small shell script that adds an extension ".new" to all the files in a directory.

    Nawaz

    • Jun 9th, 2017

    For f in *; do mv $f ${f}.new; done

    Nawaz

    • Oct 25th, 2016

    For item in `ls`; do mv $item ${item}.new; done

    Code
    1. for item in `ls`; do mv $item ${item}.new; done

  • Lab Testing with Limited Resource

    How do you assure the quality of a system that in production is deployed to several large servers so as to scale to thousands of users and handle millions of data points when all you have is a test lab with much more limited resources?

  • Print Sum of Digits

    Write a function to print sum of the digits in a given integer n without converting it to String. For example : if n = 1234 the function should return 1+2+3+4 = 10 if n = 15 the function should return 1+5 =6 if n = 5 the function should return 5.

    sravani reddy

    • Sep 21st, 2017

    Code
    1. #include<stdio.h>
    2. int main()
    3. {
    4. int rem,sum=0,n;
    5. printf("enter the number:");
    6. scanf("%d
    7. ",&n);
    8. while(n!=0)
    9. {
    10. rem=n%10;
    11. sum=sum+rem;
    12. n=n/10;
    13. }
    14. printf("the sum of digits of a number is %d",sum);
    15. return 0;
    16. }

    Shasan

    • Mar 29th, 2016

    "c# public static int Sum() { int n = 1235678; int n1 = 0; int f = 0; while (n!= 0) { ...