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 (2266)
 C++ interview questions  C++ Interview Questions (1121)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (652)
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 ?    39 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 ?    23 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
 
which one low Priority in c? a)=,b)++,c)==,d)+   10
how can i calculate mean,median,mode by using c program HCL 1
long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes HCL 18
what is answer for perfect number????????????????   1
a simple c program using 'for' loop to display the output 5 4 3 2 1   1
There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side? Google 8
SIR PLS TELL ME THE CODE IN C LANGUAGE TO PRINT THE FOLLOWING SERIES 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 2 1 1 2 1 1   4
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?   9
how to find out the reverse number of a digit if it is input through the keyboard?   6
i want to asked a question about c program the question is: create a c program that displays all prime numbers less than 500? using looping statement   5
main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....   2
The operation of a stair case switch best explains the a) or operation b) and operation c)exclusive nor operation d)exclusive or operation Which of the following is/are syntactically correct? a) for(); b) for(;); c) for(,); d) for(;;); HCL 1
 
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