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..

Answer Posted / vignesh1988i

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

FILE PROGRAMMING

1771


why return type of main is not necessary in linux

1695


What are inbuilt functions in c?

553


What is the difference between text and binary modes?

637


write a program to create a sparse matrix using dynamic memory allocation.

4363






using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1302


Explain the use of fflush() function?

618


Process by which one bit pattern in to another by bit wise operation is?

608


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

671


What is array within structure?

574


Can you apply link and association interchangeably?

663


What is volatile variable in c with example?

579


What is the general form of a C program?

593


What is the size of structure pointer in c?

605


What do you mean by dynamic memory allocation in c?

639