| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Write a C++ program without using any loop (if, for, while
etc) to print numbers from 1 to 100 and 100 to 1;
| | 7 |
| a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6
| TCS | 5 |
| where does malloc() function get the memory? | | 1 |
| for(i=0;i=printf("Hello");i++);
printf("Hello");
how many times how will be printed????????? | | 4 |
| What are the uses of pre-processor directives? | | 2 |
| Unsigned char c;
for ( c=0;c!=256;c++2)
printf("%d",c);
No. of times the loop is executed ?
| Mascot | 3 |
|
#include<stdio.h>
int SumElement(int *,int);
void main(void)
{
int x[10];
int i=10;
for(;i;)
{
i--;
*(x+i)=i;
}
printf("%d",SumElement(x,10));
}
int SumElement(int array[],int size)
{
int i=0;
float sum=0;
for(;i<size;i++)
sum+=array[i];
return sum;
}
output? | Ramco | 5 |
| i want to have a program to read a string and print the
frequency of each character and it should work in turbo c | | 2 |
| How can we open a file in Binary mode and Text mode?what is
the difference? | PanTerra | 1 |
| Write an implementation of “float stringToFloat(char *str).”
The code should be simple, and not require more than the
basic operators (if, for, math operators, etc.).
• Assumptions
• Don’t worry about overflow or underflow
• Stop at the 1st invalid character and return the number
you have converted till then, if the 1st character is
invalid return 0
• Don’t worry about exponential (e.g. 1e10), instead you
should treat ‘e’ as an invalid character
• Write it like real code, e.g. do error checking
• Go though the string only once
• Examples
• “1.23” should return 1.23
• “1a” should return 1
• “a”should return 0
| Qualcomm | 5 |
| what is the return value (status code) of exit() function....
what the arguments(integer value) passed to it means.... | TCS | 1 |
| write a program for even numbers? | | 8 |
| how to convert binary to decimal and decimal to binary in C
lanaguage | | 4 |
| what is a headerfile?and what will be a program without it
explain nan example? | Assurgent | 5 |
| HOW TO HANDLE EXCEPTIONS IN C | | 5 |
| plz answer..... a program that reads non-negative integer
and computes and prints its factorial | | 2 |
| parkside's triangle..
create a program like this..
enter the size: 6
enter the seed: 1
output:
1
23
456
7891
23456
789123
sample2:
enter the size: 5
enter the seed: 3
output:
3
45
678
9123
45678
parkside should not exceed 10 while its seed should only be
not more than 9.. | | 4 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}
| ME | 2 |
| could u able to tell about suresoft technical session | | 1 |
| what is pointer ? | Kernex-Micro-Systems | 7 |
| |
| For more C Interview Questions Click Here |