ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2253)
 C++ interview questions  C++ Interview Questions (1111)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
Question
1. Write a c pgm to print 1 to 100 without using loops.
2. Write a c pgm for leap year  
3. Write a c pgm fibbonacci series,factorial
4. Write a c pgm count no of lines , blanks, tabs in a 
para(File concept) 
5. Write a c pgm to print the letter as per given condition
      i.e.. if u give 4
    out put should b 
    4 4 4 4
    4 4 4 4
     4 4 4 4
    4 4 4 4
6.how do get the o/p in number from 1 to 100 in the screen 
without using    control statement?
7. who do u print the word "hello world" without using 
"printf" statement?
8. write sql program to get the detail of student in a 
class?
     Definitions:
     structure
     union
     arrays 
     linkedlist
     macros
     directives
     difference b/w 
    pre processorsDiffrence:
1.Constructors and destructors 
2.Structure and Union
3.Array and Lists
4.pre processor...
5. Privillages in C++
6.structure and union 
7.break and continue 
8.while and dowhile Pgm..
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
1) 1 -100 without looping....

#include<stdio.h>
#include<conio.h>
int i=1;
void main()
{
i<=100 ? printf("%d\n",i) : getch(); //conditional operator
i++;
main(); //recursive calling of main() function
}


7) printing a string without printf()

#include<stdio.h>
#include<conio.h>
void main()
{
if(printf("hello world"))
getch();
}

5) printing ur sequence

#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("enter ur number:");
scanf("%d",&m);
for(int i=1;i<=m;i++)
{
for(int j=1;j<=m;j++)
printf("%d ",m);
printf("\n");
}
getch();
}

6) printing 1-100 without using loops as well as control statement...

same answer which i have made for your QUESTON 1... and conditional operator is not a control statement...

3) a) very basic and simple logic fabbonacci series:

#include<stdio.h>
#include<conio.h>
void main()
{
int a=1,b=-1,c,n;
printf("enter the no. of terms :");
scanf("%d",&n);
for(int i=1;i<=m;i++)
{
c=a+b;
printf("%d\n",c);
b=a;
a=c;
}
getch();
}

b) Factorial :

#include<stdio.h>
#include<conio.h>
void main()
{
int m,j=1;
printf("enter ur number :");
scanf("%d",&m);
for(int i=1;i<=m;i++)
j=j*i;
printf("the factorial is : j");
getch();
}

remaining i ll answer today evening....

thank u
 
Is This Answer Correct ?    38 Yes 13 No
Vignesh1988i
 
Answer
# 2
5.
void main()
{
int n,i,j;
printf("Enter the number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
printf("%d\t",n);
}
printf("\n");
}
getch();
}
 
Is This Answer Correct ?    22 Yes 7 No
Karna
 
 
 
Answer
# 3
8:ANSWER
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,n;
printf(“enter the n value:);
scanf(“%d”,&n);
while(n>i)
{
printf(“this is while condition programe”);
}
getch();
}
 
Is This Answer Correct ?    10 Yes 5 No
Antony Btitto
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none Oracle 8
discuss the steps needed to get a program from source code to executable in a system?   1
question-how to run a c programme.   6
I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....   2
Explain in detail how strset (string handling function works )pls explain it with an example.   1
if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how? Wipro 8
What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value. TCS 10
write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101) Bosch 1
How to convert decimal to binary in C using recursion?? IBM 4
#include<stdio.h> #include<conio.h> void main() { int m=0111,n=20; printf("%d%d\n",m,n); getch(); }   1
Write a c program to Find the name that you entered is male name or female name? Such as Sunjay is name of male and Payal is name of female Infosys 5
main() { int i; printf("%d",scanf"%d",&i))//if the input is 12 24 34 then wat will be the output }   2
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com