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 (2254)
 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
 
write a “Hello World” program in “c” without using a semicolon? CTS 9
What are pointers in C? KPIT 5
what is calloc and malloc?   2
discuss the steps needed to get a program from source code to executable in a system?   1
How can I allocate arrays or structures bigger than 64K?   5
HOW TO HANDLE EXCEPTIONS IN C   8
How can draw a box in cprogram without using graphics.h header file & using only one printf(); ? NIIT 4
Input is "Jack and jill went up a hill" To print output is 1-letter word(s)-1 2-letter words-1 3-letter words-1 4-letter words-4 Mind-Tree 1
c pgm count no of lines , blanks, tabs in a para(File concept)   2
WAP to convert text into its ASCII Code and also write a function to decode the text given?   2
which operator having highest precedence? a.)+ b.)++ c.)= d.)%   4
can any one tell that i have a variable which is declared as static but i want this variable to be visible to the other files? how?   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