AD (728x90)

  • SeminarSparkzInc

    Seminar Sparkz Inc

    Seminars on new technologies for BTech and MCA students.IT and and Non-IT Jobs Information for B.Tech,MCA,M.Tech and MBA Students

  • eJobMinds

    eJobMinds

    It provides information about all IT and Non-IT jobs.

  • onlineexam

    Free Online Exam

    Test your knowlege on various domains.Write free test on reasoning and aptitude,General english,Java,Operating System,C-language,CPP,HTML,J2ME,General Knowledge etc.

  • SoftwareSparkz

    Software Sparkzz

    This blog contains the stuff related to the softwares and new technologies.

GoogleOnline Exam Test Seminar Sparkz IncEasy Link Exchange

Feature Top (Full Width)

Latest Updates

Saturday 31 May 2014

Write a C program to read in two numbers, x and n, and then compute the sum of this geometric progression: 1+x+x2+x3+????

Seminars and Jobs information
/*Write a C program to read in two numbers, x and n, and then compute the sum of this geometric progression:
1+x+x2+x3+????.+xn For example: if n is 3 and x is 5, then the program computes 1+5+25+125.
Print x, n, the sum Perform error checking. For example, the formula does not make sense
for negative exponents - if n is less than 0. Have your program print an error message if n<0, 
then go back and read in the next pair of numbers of without computing the sum.
Are any values of x also illegal ? If so, test for them too. */

#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
int s_sum,i,x,n;

clrscr();
printf("Enter the values for x and n:");
scanf("%d %d",&x,&n);
For more Click

Write a C program to construct a pyramid of numbers.

Seminars and Jobs information
/* Write a C program to construct a pyramid of numbers. */

#include<stdio.h>
#include<conio.h>

void main()
{
int num,i,y,x=35;
clrscr();
printf("\nEnter the number to generate the pyramid:\n");
scanf("%d",&num);
For more Click

Write a C program to generate Pascal's triangle.

Seminars and Jobs information
/* Write a C program to generate Pascal's triangle. */

#include<stdio.h>
#include<conio.h>

void main()
{
int bin,p,q,r,x;
clrscr();
bin=1;
q=0;

printf("Rows you want to input:");
scanf("%d",&r);
For more Click

Write a C program that displays the position or index in the string S where the string T begins, or - 1 if S doesn't contain T.

Seminars and Jobs information
/* Write a C program that displays the position or index in the string S
  where the string T begins, or - 1 if S doesn't contain T.
*/

#include<stdio.h>
#include<string.h>
#include<conio.h>

void main()
{
 char s[30], t[20];
 char *found;
 clrscr();

/* Entering the main string */
 puts("Enter the first string: ");
 gets(s);
For more Click

Write a C program to count the lines, words and characters in a given text

Seminars and Jobs information
/* Write a C program to count the lines, words and characters in a given text*/

Program
#include <stdio.h>
main()
{
char line[81], ctr;
int i,c,
end = 0,
characters = 0,
words = 0,
lines = 0;
For more Click

Write a C program that uses functions to perform the following operations: To delete n Characters from a given position in a given string.

Seminars and Jobs information
/* Write a C program that uses functions to perform the following operations:
  To delete n Characters from a given position in a given string.
*/

#include <stdio.h>
#include <conio.h>
#include <string.h>

void delchar(char *x,int a, int b);

void main()
{
    char string[10];
    int n,pos,p;
    clrscr();

    puts("Enter the string");
    gets(string);
For more Click

Write a C program to determine if the given string is a palindrome or not

Seminars and Jobs information
/* Write a C program to determine if the given string is a palindrome or not */

#include<stdio.h>
#include<string.h>

enum Boolean{false,true};
enum Boolean IsPalindrome(char string[])
{
int left,right,len=strlen(string);
enum Boolean matched=true;
if(len==0)
 return 0;
 left=0;
 right=len-1;
For more Click

Feature (Side)

© 2013 Learning Java. All rights resevered. Designed by Templateism