shruti


{ City } pune
< Country > india
* Profession * sap - technical consultant
User No # 13969
Total Questions Posted # 0
Total Answers Posted # 68

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 1350
Users Marked my Answers as Wrong # 556
Answers / { shruti }

Question { Accenture, 9762 }

Which of these statements are false w.r.t File Functions?
i)fputs() ii)fdopen() iii)fgetpos() iv)ferror()
A)ii B)i,ii C)iii D)iv


Answer

ii -> fdopen

Is This Answer Correct ?    3 Yes 0 No

Question { Nest, 43245 }

what is difference between array of characters and string


Answer

In case of a string, we cant print each character by
character whereas for arrays of char we can do that.

String is terminated by a NULL character by default.
in array we have to explicitly do that.

Is This Answer Correct ?    20 Yes 16 No


Question { Accenture, 22232 }

char ch=10;printf("%d",ch);what is the output


Answer

@Devvvv
every character has an ascii value..
it is not that only 0 - 9 has ascii values.. even 10 , 20
has ascii values.

each and every value has an ascii value..

comming back to the ques:
i think it will give the ascii value of 10...

Is This Answer Correct ?    3 Yes 4 No

Question { Accenture, 107946 }

how can u draw a rectangle in C


Answer

include graphics.h

rectangle(int,int,int,int)

closegraph()

Is This Answer Correct ?    17 Yes 14 No

Question { TCS, 27122 }

what will be the output:
main(){char ch;int a=10;printf("%d",ch);}


Answer

it will print the ascii value of the characters..
or some garbage values..

Is This Answer Correct ?    1 Yes 0 No

Question { Wipro, 8270 }

how to return a multiple value from a function?


Answer

use call by refrance..-> pointers.

Is This Answer Correct ?    0 Yes 1 No

Question { Deshaw, 12601 }

Write code for initializing one dimentional and two
dimentional array in a C Program?


Answer

Ans no. 4 is correct..

incase u have to initialise an array have more number of
elements as i 100 or 200..

eg..

int a[50];
then u can use following functions:

**YOU CAN INITIALISE IT TO A PARTICULAR VALUE ONLY USING
THE BELOW CODE..

int a[50];
int i;

for (i = 0 ; i < 50 ; i++)
{
a[i] = 0;
}

similarly for 2D

for(i = 0 ; i < 50 ; i++)
{
for(j = 0 ; j < 50 ; j++)
{
a[i][j] = 0;
}
}

Is This Answer Correct ?    11 Yes 3 No

Question { CTS, 26467 }

how many argument we can pas in in a function


Answer

i think it depends upon the compiler version..

Is This Answer Correct ?    2 Yes 0 No

Question { CTS, 11835 }

palindrome for strings and numbers----Can anybody do the
prog?


Answer

//the palindrome for string can also be written as below,
without using inbuilt functions.

void main()
{
char str[10];
int flag = 0;
int i , j;

puts("ENTER THE STRING");
fflush(stdin);
gets(str);


for(i = 0 ; str[i] != '\0' ; i++);
i--;

for(j = 0 ; j {
if(str[j] == str[i])
flag = 1;
else
{
flag = 0;
break;
}
}

if(flag == 1)
puts("STRING IS A PALINDROME");
else
puts("STRING IS NOT A PALINDROME");
}

Is This Answer Correct ?    4 Yes 3 No

Question { 7025 }

What are the phases in s/w developed life cycle?
wat is the diff b/w stack & queue...where do we use stack


Answer

The phases of SDLC are:
**Communication.
**Requirements gathering
**Analysis
**Implementation
**Testing
**Maintainance


Differance between stack and queue..

Stack follows LIFO structure i.e -> last in first out.
the element which enters last exits first..

Queue follows FIFO structure. i.e -> first in first out.
the element which enters first exits first..


USE OF STACK:
with refrance to C, we use stack wiht the program counter.
i.e when we jump to a function, we store the address to
return to on a stack..

u can understand this in more detail if you study teh
actual flow of program while calling functions.

Is This Answer Correct ?    1 Yes 1 No

Question { NetApp, 15366 }

Link list in reverse order.


Answer

/*
the structure is as follows:
struct node
{
int data;
struct node *next;
}
*/

struct node * reverse (struct node *home , struct node *rev)
{
struct node temp , *p;

if(home != NULL)
{
temp = home;
while(temp != NULL)
{
//this part will create a new node with the name p.
p = myalloc;
p -> data = temp -> data;
p -> next = NULL;

if(rev == NULL)
rev = p;
else
{
p -> next = rev;
rev = p;
}
temp = temp -> next;
}
}
return rev;
}

Is This Answer Correct ?    5 Yes 0 No

Question { NetApp, 15366 }

Link list in reverse order.


Answer

//Go through the code, incase any issues feel free to
revert.

Copying a link list:

//home is the stationary pointer of the main linked list
which is to be copied.

//head is the stationary pointer of the new linked list
which has to be created..

//temp and temp1 are the moving pointers attached to the
respective linked list...


struct node *copy(struct node *home , struct node *head)
{
struct node *temp , *temp1 , *p;

temp = home;
while(temp != NULL)
{
p = (struct node *) malloc (sizeof(struct node));
p -> data = temp -> data;

if(head == NULL)
head = p;

else
{
temp1 = head;
while(temp1 -> next != NULL)
temp1 = temp1 -> next;

temp1 -> next = p;
}
temp = temp -> next;
}
return head;
}

Is This Answer Correct ?    1 Yes 0 No

Question { Caritor, 9396 }

IS STRUCTURES CAN BE USED WITHIN AN ARRAY?


Answer

yesss.

we do used structures within arrays..

struct student
{
char name[20];
int roll_no;
}s[10]

this is array of structures..

we use "."(dot) operator to access the element
s[i].name = ""
s[i].roll_no = ...

Is This Answer Correct ?    2 Yes 1 No

Question { CTS, 17708 }

My Successful Placement Paper with CTS {Recruitment Paper April
15 2007}


Answer

**The above answer is correct..


no of students playing only tt -> 40
no of students playing only badminton -> 40
no of students playing only cricket -> 37

No of students playing all the three -> 16
student playin TT + badminton -> 9
student playin TT + cricket -> 8
student playin cricket + badminton -> 9

hence total number of students is
40 + 40 + 37 + 16 + 9 + 8 + 9..

which is 164..

Is This Answer Correct ?    3 Yes 0 No

Question { Nipuna, 3984 }

what are the interview question's in the language c


Answer

Interview questions in C would be :

- what are pointers?
- what do the .h files mean?

my fav ques - which i will always ask is :
** what is the differance between a[0] and *a.



Is This Answer Correct ?    2 Yes 1 No

Prev    1   2    [3]   4   5    Next