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
46. m getting the result FFF0..
plz correct me if m wrong..
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / swastisundar bose
46.
0000000000000001
47.The progrm will compile,because it is syntactically
correct.
51.
#include<stdio.h>
int fact(int n){
if(n==0||n==1)
return(1);
else
return(n*fact(n-1));
}
void main(){
int a,b;
printf("Enter number:-");
scanf("%d",&a);
b=fact(a);
printf("\nThe factorial value of the number:- %d",b);
}
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / supriya
46. fffffff0
49.#include<stdio.h>
main()
{
int a,b;
scanf("%d%d",&a,&b);
a=a^b;
b=a^b;
a=a^b;
printf("%d%d",a,b);
}
48.
void strcpy(char *s, char *t)
{
while (*s++ = *t++)
;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / dhina
#include<stdio.h>
#include<conio.h>
void fact();
void main()
{
clrscr();
fact();
getch();
}
void fact()
{
int n,f;
scanf("%d",&n);
if(n==1)
{
return(1);
}
else
{
f=(n*fact(n-1));
printf("%d",f);
}
}
Is This Answer Correct ? | 4 Yes | 6 No |
Answer / siyaoberoi
44. strcpy() copies only string.it doesnt copy the memory
location.memcpy() copies the memory location of the string.
Is This Answer Correct ? | 0 Yes | 2 No |
Why c is called procedure oriented language?
compare array with pointer?
What is wrong with this code such that it doesnt produce the input reversed? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char Space = ' '; char LineOfText; float count; LineOfText = getchar(); while ((LineOfText = getchar()) != '/n'); { count = strlen(LineOfText) - 1; while (count >= 0) { putchar(LineOfText[count]); count--; } } getchar(); return 0; }
Is c is a low level language?
What is string length in c?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
post new interiew question and aptitude test papers
what is difference between userlevel threads and kernel level threads ?what are the trades offs between these two approaches ? what approach is most frequently used and why ?
Which is better between malloc and calloc?
What are the benefits of c language?
Write a program to check armstrong number in c?
main() { float f1=10.5; double db1=10.5 if(f1==db1) printf("a"); else printf("b") }