44.what is the difference between strcpy() and memcpy()
function?
45.what is output of the following statetment?
46.Printf(“%x”, -1<<4); ?
47.will the program compile?
int i;
scanf(“%d”,i);
printf(“%d”,i);
48.write a string copy function routine?
49.swap two integer variables without using a third
temporary variable?
50.how do you redirect stdout value from a program to a file?
51.write a program that finds the factorial of a number
using recursion?
Answers were Sorted based on User's Feedback
sorry... I made a mistake in the previous 51.answer
i am very sorry...
the solution for recursion is...
long factorial(long n){
return (n==0 || n==1)?1:n * factorial(n-1);
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sachin patil
44. strcpy copy the string while memcpy copy the memory
contains of locations.
46.fffffff0
49. int a = 5;
int b = 10;
a = a+b;
b = a-b;
a = a-b;
| Is This Answer Correct ? | 2 Yes | 0 No |
51.factorial of a number using recursion
long factorial(long n){
return (n==0 || n==1)?1:n*n-1;
}
| Is This Answer Correct ? | 0 Yes | 2 No |
simple c program for 12345 convert 54321 with out using string
Why is event driven programming or procedural programming, better within specific scenario?
when user give a number it multiply with 9 without useing '+' and '*' oprator
#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output?
Differentiate between Macro and ordinary definition.
Is using exit() the same as using return?
Is a house a shell structure?
main() { static int ivar=5; printf("%d",ivar--); if(ivar) main(); }
What is volatile keyword in c?
Write a small C program to determine whether a machine's type is little-endian or big-endian.
Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;